makepanda.py 318 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except KeyboardInterrupt:
  19. raise
  20. except:
  21. print("You are either using an incomplete or an old version of Python!")
  22. print("Please install the development package of Python and try again.")
  23. exit(1)
  24. from makepandacore import *
  25. from distutils.util import get_platform
  26. import time
  27. import os
  28. import sys
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMVERSION=None
  57. RPMRELEASE="1"
  58. GIT_COMMIT=None
  59. P3DSUFFIX=None
  60. MAJOR_VERSION=None
  61. COREAPI_VERSION=None
  62. PLUGIN_VERSION=None
  63. OSXTARGET=None
  64. OSX_ARCHS=[]
  65. HOST_URL=None
  66. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  67. STRDXSDKVERSION = 'default'
  68. WINDOWS_SDK = None
  69. MSVC_VERSION = None
  70. BOOUSEINTELCOMPILER = False
  71. OPENCV_VER_23 = False
  72. PLATFORM = None
  73. COPY_PYTHON = True
  74. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  75. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  76. PkgListSet(["PYTHON", "DIRECT", # Python support
  77. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  78. "EGL", # OpenGL (ES) integration
  79. "EIGEN", # Linear algebra acceleration
  80. "OPENAL", "FMODEX", # Audio playback
  81. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  82. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  83. "SPEEDTREE", # SpeedTree
  84. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  85. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  86. "FREETYPE", "HARFBUZZ", # Text rendering
  87. "VRPN", "OPENSSL", # Transport
  88. "FFTW", # Algorithm helpers
  89. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  90. "GTK2", # GTK2 is used for PStats on Unix
  91. "MFC", "WX", "FLTK", # Used for web plug-in only
  92. "ROCKET", # GUI libraries
  93. "CARBON", "COCOA", # macOS toolkits
  94. "X11", # Unix platform support
  95. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  96. "SKEL", # Example SKEL project
  97. "PANDAFX", # Some distortion special lenses
  98. "PANDAPARTICLESYSTEM", # Built in particle system
  99. "CONTRIB", # Experimental
  100. "SSE2", "NEON", # Compiler features
  101. "MIMALLOC", # Memory allocators
  102. ])
  103. CheckPandaSourceTree()
  104. def keyboardInterruptHandler(x,y):
  105. exit("keyboard interrupt")
  106. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  107. ########################################################################
  108. ##
  109. ## Command-line parser.
  110. ##
  111. ## You can type "makepanda --help" to see all the options.
  112. ##
  113. ########################################################################
  114. def usage(problem):
  115. if (problem):
  116. print("")
  117. print("Error parsing command-line input: %s" % (problem))
  118. print("")
  119. print("Makepanda generates a 'built' subdirectory containing a")
  120. print("compiled copy of Panda3D. Command-line arguments are:")
  121. print("")
  122. print(" --help (print the help message you're reading now)")
  123. print(" --verbose (print out more information)")
  124. print(" --runtime (build a runtime build instead of an SDK build)")
  125. print(" --tests (run the test suite)")
  126. print(" --installer (build an installer)")
  127. print(" --wheel (build a pip-installable .whl)")
  128. print(" --optimize X (optimization level can be 1,2,3,4)")
  129. print(" --version X (set the panda version number)")
  130. print(" --lzma (use lzma compression when building Windows installer)")
  131. print(" --distributor X (short string identifying the distributor of the build)")
  132. print(" --outputdir X (use the specified directory instead of 'built')")
  133. print(" --host URL (set the host url (runtime build only))")
  134. print(" --threads N (use the multithreaded build system. see manual)")
  135. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  136. print(" --universal (build universal binaries (macOS only))")
  137. print(" --override \"O=V\" (override dtool_config/prc option value)")
  138. print(" --static (builds libraries for static linking)")
  139. print(" --target X (experimental cross-compilation (android only))")
  140. print(" --arch X (target architecture for cross-compilation)")
  141. print("")
  142. for pkg in PkgListGet():
  143. p = pkg.lower()
  144. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  145. if sys.platform != 'win32':
  146. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  147. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  148. print("")
  149. print(" --nothing (disable every third-party lib)")
  150. print(" --everything (enable every third-party lib)")
  151. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  152. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1, 10 or 11. Default is 7.1)")
  153. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
  154. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  155. print("")
  156. print("The simplest way to compile panda is to just type:")
  157. print("")
  158. print(" makepanda --everything")
  159. print("")
  160. os._exit(1)
  161. def parseopts(args):
  162. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  163. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  164. global DEBVERSION,WHLVERSION,RPMVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  165. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  166. global COPY_PYTHON
  167. # Options for which to display a deprecation warning.
  168. removedopts = [
  169. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  170. ]
  171. # All recognized options.
  172. longopts = [
  173. "help","distributor=","verbose","runtime","osxtarget=","tests",
  174. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  175. "version=","lzma","no-python","threads=","outputdir=","override=",
  176. "static","host=","debversion=","rpmversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  177. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  178. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  179. "cggl-incdir=", "cggl-libdir=",
  180. ] + removedopts
  181. anything = 0
  182. optimize = ""
  183. target = None
  184. target_archs = []
  185. universal = False
  186. clean_build = False
  187. for pkg in PkgListGet():
  188. longopts.append("use-" + pkg.lower())
  189. longopts.append("no-" + pkg.lower())
  190. longopts.append(pkg.lower() + "-incdir=")
  191. longopts.append(pkg.lower() + "-libdir=")
  192. try:
  193. opts, extras = getopt.getopt(args, "", longopts)
  194. for option, value in opts:
  195. if (option=="--help"): raise Exception
  196. elif (option=="--optimize"): optimize=value
  197. elif (option=="--installer"): INSTALLER=1
  198. elif (option=="--tests"): RUNTESTS=1
  199. elif (option=="--wheel"): WHEEL=1
  200. elif (option=="--verbose"): SetVerbose(True)
  201. elif (option=="--distributor"): DISTRIBUTOR=value
  202. elif (option=="--rtdist"): RTDIST=1
  203. elif (option=="--runtime"): RUNTIME=1
  204. elif (option=="--genman"): GENMAN=1
  205. elif (option=="--everything"): PkgEnableAll()
  206. elif (option=="--nothing"): PkgDisableAll()
  207. elif (option=="--threads"): THREADCOUNT=int(value)
  208. elif (option=="--outputdir"): SetOutputDir(value.strip())
  209. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  210. elif (option=="--universal"): universal = True
  211. elif (option=="--target"): target = value.strip()
  212. elif (option=="--arch"): target_archs.append(value.strip())
  213. elif (option=="--nocolor"): DisableColors()
  214. elif (option=="--version"):
  215. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  216. if not match:
  217. usage("version requires three digits")
  218. WHLVERSION = value
  219. VERSION = match.group()
  220. elif (option=="--lzma"): COMPRESSOR="lzma"
  221. elif (option=="--override"): AddOverride(value.strip())
  222. elif (option=="--static"): SetLinkAllStatic(True)
  223. elif (option=="--host"): HOST_URL=value
  224. elif (option=="--debversion"): DEBVERSION=value
  225. elif (option=="--rpmversion"): RPMVERSION=value
  226. elif (option=="--rpmrelease"): RPMRELEASE=value
  227. elif (option=="--git-commit"): GIT_COMMIT=value
  228. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  229. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  230. # Backward compatibility, OPENGL was renamed to GL
  231. elif (option=="--use-opengl"): PkgEnable("GL")
  232. elif (option=="--no-opengl"): PkgDisable("GL")
  233. elif (option=="--directx-sdk"):
  234. STRDXSDKVERSION = value.strip().lower()
  235. if STRDXSDKVERSION == '':
  236. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  237. STRDXSDKVERSION = 'default'
  238. elif (option=="--windows-sdk"):
  239. WINDOWS_SDK = value.strip().lower()
  240. elif (option=="--msvc-version"):
  241. MSVC_VERSION = value.strip().lower()
  242. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  243. elif (option=="--clean"): clean_build = True
  244. elif (option=="--no-copy-python"): COPY_PYTHON = False
  245. elif (option[2:] in removedopts):
  246. Warn("Ignoring removed option %s" % (option))
  247. else:
  248. for pkg in PkgListGet() + ['CGGL']:
  249. if option == "--use-" + pkg.lower():
  250. PkgEnable(pkg)
  251. break
  252. elif option == "--no-" + pkg.lower():
  253. PkgDisable(pkg)
  254. break
  255. elif option == "--" + pkg.lower() + "-incdir":
  256. PkgSetCustomLocation(pkg)
  257. IncDirectory(pkg, value)
  258. break
  259. elif option == "--" + pkg.lower() + "-libdir":
  260. PkgSetCustomLocation(pkg)
  261. LibDirectory(pkg, value)
  262. break
  263. if (option == "--everything" or option.startswith("--use-")
  264. or option == "--nothing" or option.startswith("--no-")):
  265. anything = 1
  266. except:
  267. usage(sys.exc_info()[1])
  268. if not anything:
  269. if RUNTIME:
  270. PkgEnableAll()
  271. else:
  272. usage("You should specify a list of packages to use or --everything to enable all packages.")
  273. if (RTDIST and RUNTIME):
  274. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  275. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  276. elif (optimize==""): optimize = "3"
  277. if OSXTARGET:
  278. parts = OSXTARGET.strip().split('.')
  279. try:
  280. assert len(parts) <= 2
  281. maj = int(parts[0])
  282. min = 0
  283. if len(parts) > 1:
  284. min = int(parts[1])
  285. OSXTARGET = maj, min
  286. assert OSXTARGET >= (10, 4)
  287. except:
  288. usage("Invalid setting for --osxtarget")
  289. else:
  290. OSXTARGET = None
  291. if target is not None or target_archs:
  292. SetTarget(target, target_archs[-1] if target_archs else None)
  293. if universal:
  294. if target_archs:
  295. exit("--universal is incompatible with --arch")
  296. if OSXTARGET:
  297. osxver = OSXTARGET
  298. else:
  299. maj, min = platform.mac_ver()[0].split('.')[:2]
  300. osxver = int(maj), int(min)
  301. if osxver < (10, 15):
  302. OSX_ARCHS.append("i386")
  303. if osxver < (10, 6):
  304. OSX_ARCHS.append("ppc")
  305. else:
  306. OSX_ARCHS.append("x86_64")
  307. if osxver >= (11, 0):
  308. OSX_ARCHS.append("arm64")
  309. elif target_archs:
  310. OSX_ARCHS = target_archs
  311. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  312. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  313. 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. if WHLVERSION is None:
  381. WHLVERSION = VERSION
  382. print("Version: %s" % VERSION)
  383. if RUNTIME or RTDIST:
  384. print("Core API Version: %s" % COREAPI_VERSION)
  385. if DEBVERSION is None:
  386. DEBVERSION = VERSION
  387. if RPMVERSION is None:
  388. RPMVERSION = VERSION
  389. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  390. if P3DSUFFIX is None:
  391. P3DSUFFIX = MAJOR_VERSION
  392. # Now determine the distutils-style platform tag for the target system.
  393. target = GetTarget()
  394. target_arch = GetTargetArch()
  395. if target == 'windows':
  396. if target_arch == 'x64':
  397. PLATFORM = 'win-amd64'
  398. else:
  399. PLATFORM = 'win32'
  400. elif target == 'darwin':
  401. if OSXTARGET:
  402. osxver = OSXTARGET
  403. else:
  404. maj, min = platform.mac_ver()[0].split('.')[:2]
  405. osxver = int(maj), int(min)
  406. if osxver[0] >= 11:
  407. # I think Python pins minor version to 0 from macOS 11 onward
  408. osxver = (osxver[0], 0)
  409. arch_tag = None
  410. if not OSX_ARCHS:
  411. arch_tag = target_arch
  412. elif len(OSX_ARCHS) == 1:
  413. arch_tag = OSX_ARCHS[0]
  414. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  415. arch_tag = 'fat'
  416. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  417. arch_tag = 'intel'
  418. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  419. arch_tag = 'fat64'
  420. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  421. arch_tag = 'fat32'
  422. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  423. arch_tag = 'universal'
  424. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  425. arch_tag = 'universal2'
  426. else:
  427. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  428. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  429. 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"):
  430. # This is manylinux1. A bit of a sloppy check, though.
  431. if target_arch in ('x86_64', 'amd64'):
  432. PLATFORM = 'manylinux1-x86_64'
  433. elif target_arch in ('arm64', 'aarch64'):
  434. PLATFORM = 'manylinux1-aarch64'
  435. else:
  436. PLATFORM = 'manylinux1-i686'
  437. 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"):
  438. # Same sloppy check for manylinux2010.
  439. if target_arch in ('x86_64', 'amd64'):
  440. PLATFORM = 'manylinux2010-x86_64'
  441. elif target_arch in ('arm64', 'aarch64'):
  442. PLATFORM = 'manylinux2010-aarch64'
  443. else:
  444. PLATFORM = 'manylinux2010-i686'
  445. 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"):
  446. # Same sloppy check for manylinux2014.
  447. if target_arch in ('x86_64', 'amd64'):
  448. PLATFORM = 'manylinux2014-x86_64'
  449. elif target_arch in ('arm64', 'aarch64'):
  450. PLATFORM = 'manylinux2014-aarch64'
  451. else:
  452. PLATFORM = 'manylinux2014-i686'
  453. 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"):
  454. # Same sloppy check for manylinux_2_24.
  455. if target_arch in ('x86_64', 'amd64'):
  456. PLATFORM = 'manylinux_2_24-x86_64'
  457. elif target_arch in ('arm64', 'aarch64'):
  458. PLATFORM = 'manylinux_2_24-aarch64'
  459. else:
  460. PLATFORM = 'manylinux_2_24-i686'
  461. 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"):
  462. # Same sloppy check for manylinux_2_28.
  463. if target_arch in ('x86_64', 'amd64'):
  464. PLATFORM = 'manylinux_2_28-x86_64'
  465. elif target_arch in ('arm64', 'aarch64'):
  466. PLATFORM = 'manylinux_2_28-aarch64'
  467. else:
  468. raise RuntimeError('Unhandled arch %s, please file a bug report!' % (target_arch))
  469. elif not CrossCompiling():
  470. if HasTargetArch():
  471. # Replace the architecture in the platform string.
  472. platform_parts = get_platform().rsplit('-', 1)
  473. if target_arch == 'amd64':
  474. target_arch = 'x86_64'
  475. PLATFORM = platform_parts[0] + '-' + target_arch
  476. else:
  477. # We're not cross-compiling; just take the host arch.
  478. PLATFORM = get_platform()
  479. else:
  480. if target_arch == 'amd64':
  481. target_arch = 'x86_64'
  482. PLATFORM = '{0}-{1}'.format(target, target_arch)
  483. print("Platform: %s" % PLATFORM)
  484. outputdir_suffix = ""
  485. if (RUNTIME or RTDIST):
  486. # Compiling Maya/Max is pointless in rtdist build
  487. for ver in MAYAVERSIONS + MAXVERSIONS:
  488. PkgDisable(ver)
  489. if (DISTRIBUTOR.strip() == ""):
  490. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  491. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  492. if (RUNTIME):
  493. outputdir_suffix += "_rt"
  494. if DISTRIBUTOR == "":
  495. DISTRIBUTOR = "makepanda"
  496. elif not RTDIST_VERSION:
  497. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  498. if not RTDIST_VERSION:
  499. RTDIST_VERSION = "dev"
  500. if not IsCustomOutputDir():
  501. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  502. outputdir_suffix += '_x64'
  503. SetOutputDir("built" + outputdir_suffix)
  504. if (RUNTIME):
  505. for pkg in PkgListGet():
  506. if pkg in ["GTK2", "MFC"]:
  507. # Optional package(s) for runtime.
  508. pass
  509. elif pkg in ["OPENSSL", "ZLIB"]:
  510. # Required packages for runtime.
  511. if (PkgSkip(pkg)==1):
  512. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  513. else:
  514. # Unused packages for runtime.
  515. PkgDisable(pkg)
  516. if (INSTALLER and RTDIST):
  517. exit("Cannot build an installer for the rtdist build!")
  518. if (WHEEL and RUNTIME):
  519. exit("Cannot build a wheel for the runtime build!")
  520. if (WHEEL and RTDIST):
  521. exit("Cannot build a wheel for the rtdist build!")
  522. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  523. exit("Cannot build installer on Windows without python")
  524. if WHEEL and PkgSkip("PYTHON"):
  525. exit("Cannot build wheel without Python")
  526. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  527. exit("Cannot build rtdist without wx or fltk")
  528. if (RUNTIME):
  529. SetLinkAllStatic(True)
  530. if not os.path.isdir("contrib"):
  531. PkgDisable("CONTRIB")
  532. ########################################################################
  533. ##
  534. ## Load the dependency cache.
  535. ##
  536. ########################################################################
  537. LoadDependencyCache()
  538. ########################################################################
  539. ##
  540. ## Locate various SDKs.
  541. ##
  542. ########################################################################
  543. MakeBuildTree()
  544. SdkLocateDirectX(STRDXSDKVERSION)
  545. SdkLocateMaya()
  546. SdkLocateMax()
  547. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  548. SdkLocatePython(RTDIST)
  549. SdkLocateWindows(WINDOWS_SDK)
  550. SdkLocatePhysX()
  551. SdkLocateSpeedTree()
  552. SdkLocateAndroid()
  553. SdkAutoDisableDirectX()
  554. SdkAutoDisableMaya()
  555. SdkAutoDisableMax()
  556. SdkAutoDisablePhysX()
  557. SdkAutoDisableSpeedTree()
  558. if RTDIST and DISTRIBUTOR == "cmu":
  559. # Some validation checks for the CMU builds.
  560. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  561. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  562. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  563. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  564. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  565. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  566. if RTDIST and not HOST_URL:
  567. exit("You must specify a host URL when building the rtdist!")
  568. if RUNTIME and not HOST_URL:
  569. # Set this to a nice default.
  570. HOST_URL = "https://runtime.panda3d.org/"
  571. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  572. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  573. print("==========================================================================")
  574. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  575. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  576. print(warn_prefix + "Please upgrade to Python 3 now.")
  577. print("==========================================================================")
  578. sys.stdout.flush()
  579. # Give the user some time to contemplate their sins
  580. time.sleep(6.0)
  581. ########################################################################
  582. ##
  583. ## Choose a Compiler.
  584. ##
  585. ## This should also set up any environment variables needed to make
  586. ## the compiler work.
  587. ##
  588. ########################################################################
  589. if GetHost() == 'windows' and GetTarget() == 'windows':
  590. COMPILER = "MSVC"
  591. SdkLocateVisualStudio(MSVC_VERSION)
  592. else:
  593. COMPILER = "GCC"
  594. SetupBuildEnvironment(COMPILER)
  595. ########################################################################
  596. ##
  597. ## External includes, external libraries, and external defsyms.
  598. ##
  599. ########################################################################
  600. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  601. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  602. if (COMPILER == "MSVC"):
  603. PkgDisable("X11")
  604. PkgDisable("GLES")
  605. PkgDisable("GLES2")
  606. PkgDisable("EGL")
  607. PkgDisable("CARBON")
  608. PkgDisable("COCOA")
  609. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  610. if (PkgSkip("PYTHON")==0):
  611. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  612. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  613. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  614. for pkg in PkgListGet():
  615. if (PkgSkip(pkg)==0):
  616. if (pkg[:4]=="MAYA"):
  617. IncDirectory(pkg, SDK[pkg] + "/include")
  618. DefSymbol(pkg, "MAYAVERSION", pkg)
  619. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  620. elif (pkg[:3]=="MAX"):
  621. IncDirectory(pkg, SDK[pkg] + "/include")
  622. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  623. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  624. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  625. DefSymbol(pkg, "MAX", pkg)
  626. if (int(pkg[3:]) >= 2013):
  627. DefSymbol(pkg, "UNICODE", "")
  628. DefSymbol(pkg, "_UNICODE", "")
  629. elif (pkg[:2]=="DX"):
  630. IncDirectory(pkg, SDK[pkg] + "/include")
  631. elif GetThirdpartyDir() is not None:
  632. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  633. for pkg in DXVERSIONS:
  634. if (PkgSkip(pkg)==0):
  635. vnum=pkg[2:]
  636. if GetTargetArch() == 'x64':
  637. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  638. else:
  639. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  640. LibDirectory(pkg, SDK[pkg] + '/lib')
  641. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  642. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  643. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  644. LibName(pkg, 'dxerr.lib')
  645. else:
  646. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  647. #LibName(pkg, 'ddraw.lib')
  648. LibName(pkg, 'dxguid.lib')
  649. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  650. # dxerr needs this for __vsnwprintf definition.
  651. LibName(pkg, 'legacy_stdio_definitions.lib')
  652. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  653. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  654. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  655. LibName("WINSOCK", "wsock32.lib")
  656. LibName("WINSOCK2", "wsock32.lib")
  657. LibName("WINSOCK2", "ws2_32.lib")
  658. LibName("WINCOMCTL", "comctl32.lib")
  659. LibName("WINCOMDLG", "comdlg32.lib")
  660. LibName("WINUSER", "user32.lib")
  661. LibName("WINMM", "winmm.lib")
  662. LibName("WINIMM", "imm32.lib")
  663. LibName("WINKERNEL", "kernel32.lib")
  664. LibName("WINOLE", "ole32.lib")
  665. LibName("WINOLEAUT", "oleaut32.lib")
  666. LibName("WINOLDNAMES", "oldnames.lib")
  667. LibName("WINSHELL", "shell32.lib")
  668. LibName("WINGDI", "gdi32.lib")
  669. LibName("ADVAPI", "advapi32.lib")
  670. LibName("IPHLPAPI", "iphlpapi.lib")
  671. LibName("SETUPAPI", "setupapi.lib")
  672. LibName("GL", "opengl32.lib")
  673. LibName("GLES", "libgles_cm.lib")
  674. LibName("GLES2", "libGLESv2.lib")
  675. LibName("EGL", "libEGL.lib")
  676. LibName("MSIMG", "msimg32.lib")
  677. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  678. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  679. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  680. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  681. if (PkgSkip("MIMALLOC")==0): LibName("MIMALLOC", GetThirdpartyDir() + "mimalloc/lib/mimalloc-static.lib")
  682. if (PkgSkip("OPENSSL")==0):
  683. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  684. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  685. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  686. elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
  687. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  688. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  689. else:
  690. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
  691. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
  692. LibName("OPENSSL", "crypt32.lib")
  693. LibName("OPENSSL", "ws2_32.lib")
  694. if (PkgSkip("PNG")==0):
  695. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  696. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  697. else:
  698. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  699. if (PkgSkip("TIFF")==0):
  700. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  701. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  702. else:
  703. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  704. if (PkgSkip("OPENEXR")==0):
  705. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXRCore-3_1.lib"):
  706. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_1.lib")
  707. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_1.lib")
  708. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_1.lib")
  709. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_1.lib")
  710. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib"):
  711. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib")
  712. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_0.lib")
  713. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_0.lib")
  714. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_0.lib")
  715. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR.lib"):
  716. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR.lib")
  717. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread.lib")
  718. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath.lib")
  719. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex.lib")
  720. else:
  721. suffix = ""
  722. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  723. suffix = "-2_2"
  724. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  725. suffix = "-2_3"
  726. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  727. suffix = "-2_4"
  728. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  729. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  730. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  731. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  732. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  733. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  734. if suffix == "-2_2":
  735. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  736. else:
  737. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  738. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  739. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  740. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  741. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  742. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  743. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  744. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  745. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  746. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  747. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  748. if (PkgSkip("HARFBUZZ")==0):
  749. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  750. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  751. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  752. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  753. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  754. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  755. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  756. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  757. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  758. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  759. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  760. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  761. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  762. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  763. if (PkgSkip("FCOLLADA")==0):
  764. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  765. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  766. if (PkgSkip("ASSIMP")==0):
  767. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  768. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  769. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  770. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  771. if (PkgSkip("SQUISH")==0):
  772. if GetOptimize() <= 2:
  773. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  774. else:
  775. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  776. if (PkgSkip("ROCKET")==0):
  777. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  778. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  779. if (PkgSkip("PYTHON")==0):
  780. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  781. if (GetOptimize() <= 3):
  782. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  783. if (PkgSkip("OPENAL")==0):
  784. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  785. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  786. # Link OpenAL Soft statically.
  787. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  788. if (PkgSkip("ODE")==0):
  789. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  790. DefSymbol("ODE", "dSINGLE", "")
  791. if (PkgSkip("FMODEX")==0):
  792. if (GetTargetArch() == 'x64'):
  793. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  794. else:
  795. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  796. if (PkgSkip("FLTK")==0 and RTDIST):
  797. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  798. if not PkgSkip("FLTK"):
  799. # If we have fltk, we don't need wx
  800. PkgDisable("WX")
  801. if (PkgSkip("WX")==0 and RTDIST):
  802. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  803. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  804. DefSymbol("WX", "__WXMSW__", "")
  805. DefSymbol("WX", "_UNICODE", "")
  806. DefSymbol("WX", "UNICODE", "")
  807. if (PkgSkip("VORBIS")==0):
  808. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  809. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  810. if not os.path.isfile(path):
  811. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  812. LibName("VORBIS", path)
  813. if (PkgSkip("OPUS")==0):
  814. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  815. for lib in ('ogg', 'opus', 'opusfile'):
  816. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  817. if not os.path.isfile(path):
  818. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  819. LibName("OPUS", path)
  820. for pkg in MAYAVERSIONS:
  821. if (PkgSkip(pkg)==0):
  822. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  823. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  824. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  825. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  826. for pkg in MAXVERSIONS:
  827. if (PkgSkip(pkg)==0):
  828. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  829. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  830. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  831. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  832. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  833. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  834. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  835. if (PkgSkip("PHYSX")==0):
  836. if GetTargetArch() == 'x64':
  837. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  838. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  839. else:
  840. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  841. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  842. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  843. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  844. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  845. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  846. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  847. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  848. if (PkgSkip("SPEEDTREE")==0):
  849. if GetTargetArch() == 'x64':
  850. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  851. p64ext = '64'
  852. else:
  853. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  854. p64ext = ''
  855. debugext = ''
  856. if (GetOptimize() <= 2): debugext = "_d"
  857. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  858. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  859. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  860. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  861. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  862. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  863. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  864. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  865. LibName("SPEEDTREE", "glu32.lib")
  866. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  867. if (PkgSkip("BULLET")==0):
  868. suffix = '.lib'
  869. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  870. suffix = '_x64.lib'
  871. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  872. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  873. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  874. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  875. if (COMPILER=="GCC"):
  876. PkgDisable("MIMALLOC") # no discernable benefit over glibc
  877. if GetTarget() != "darwin":
  878. PkgDisable("CARBON")
  879. PkgDisable("COCOA")
  880. elif RUNTIME:
  881. # We don't support Cocoa in the runtime yet.
  882. PkgDisable("COCOA")
  883. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  884. # 64-bits macOS doesn't have Carbon.
  885. PkgDisable("CARBON")
  886. if GetTarget() == 'darwin':
  887. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  888. # These support only these archs, so don't build them if we're not
  889. # targeting any of the supported archs.
  890. PkgDisable("FMODEX")
  891. PkgDisable("NVIDIACG")
  892. PkgDisable("ROCKET")
  893. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  894. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  895. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  896. # Also, we can't target FMOD Ex with the 10.14 SDK
  897. PkgDisable("FMODEX")
  898. #if (PkgSkip("PYTHON")==0):
  899. # IncDirectory("PYTHON", SDK["PYTHON"])
  900. if (GetHost() == "darwin"):
  901. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  902. IncDirectory("FREETYPE", "/usr/X11/include")
  903. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  904. LibDirectory("FREETYPE", "/usr/X11/lib")
  905. if (GetHost() == "freebsd"):
  906. IncDirectory("ALWAYS", "/usr/local/include")
  907. LibDirectory("ALWAYS", "/usr/local/lib")
  908. if (os.path.isdir("/usr/PCBSD")):
  909. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  910. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  911. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  912. if GetTarget() != "windows":
  913. PkgDisable("DIRECTCAM")
  914. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  915. # WARNING! The order of the ffmpeg libraries matters!
  916. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  917. assimp_libs = ("libassimp", "libassimpd")
  918. # Name pkg-config libs, include(dir)s
  919. if (not RUNTIME):
  920. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  921. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  922. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  923. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  924. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  925. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  926. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  927. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  928. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  929. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  930. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  931. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  932. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  933. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  934. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  935. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  936. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  937. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  938. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  939. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  940. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  941. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  942. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  943. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  944. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  945. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  946. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  947. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  948. # because there's a circular dependency between the two libraries.
  949. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  950. for (opt, name) in LIBNAMES:
  951. if opt == "FREETYPE":
  952. LibName("HARFBUZZ", name)
  953. if not PkgSkip("FFMPEG"):
  954. if GetTarget() == "darwin":
  955. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  956. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  957. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  958. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  959. # Needed when linking ffmpeg statically on Linux.
  960. LibName("FFMPEG", "-Wl,-Bsymbolic")
  961. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  962. for ffmpeg_lib in ffmpeg_libs:
  963. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  964. if GetTarget() != "darwin":
  965. for fcollada_lib in fcollada_libs:
  966. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  967. if not PkgSkip("SWSCALE"):
  968. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  969. if not PkgSkip("SWRESAMPLE"):
  970. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  971. if not PkgSkip("JPEG"):
  972. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  973. if not PkgSkip("TIFF"):
  974. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  975. if not PkgSkip("PNG"):
  976. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  977. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  978. if not PkgSkip("SQUISH"):
  979. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  980. if not PkgSkip("OPENEXR"):
  981. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  982. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  983. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  984. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  985. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  986. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  987. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  988. if not PkgSkip("VORBIS"):
  989. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  990. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  991. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  992. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  993. if not PkgSkip("OPUS"):
  994. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  995. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  996. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  997. if not PkgSkip("VRPN"):
  998. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  999. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  1000. if not PkgSkip("ARTOOLKIT"):
  1001. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  1002. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  1003. if not PkgSkip("HARFBUZZ"):
  1004. LibName("HARFBUZZ", "-Wl,--exclude-libs,libharfbuzz.a")
  1005. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  1006. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  1007. if cv_lib == "opencv_core":
  1008. OPENCV_VER_23 = True
  1009. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  1010. else:
  1011. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  1012. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  1013. else:
  1014. PkgDisable("OPENCV")
  1015. if not PkgSkip("OPENAL"):
  1016. if GetTarget() == "darwin":
  1017. LibName("OPENAL", "-framework AudioUnit")
  1018. LibName("OPENAL", "-framework AudioToolbox")
  1019. LibName("OPENAL", "-framework CoreAudio")
  1020. else:
  1021. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  1022. if not PkgSkip("ASSIMP") and \
  1023. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  1024. # Also pick up IrrXML, which is needed when linking statically.
  1025. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  1026. if os.path.isfile(irrxml):
  1027. LibName("ASSIMP", irrxml)
  1028. if GetTarget() != "darwin":
  1029. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  1030. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  1031. rocket_libs = ("RocketCore", "RocketControls")
  1032. if (GetOptimize() <= 3):
  1033. rocket_libs += ("RocketDebugger",)
  1034. rocket_libs += ("boost_python",)
  1035. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  1036. if not PkgSkip("PYTHON"):
  1037. python_lib = SDK["PYTHONVERSION"]
  1038. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  1039. if GetTarget() == "linux":
  1040. LibName("PYTHON", "-lutil")
  1041. LibName("PYTHON", "-lrt")
  1042. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  1043. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  1044. SmartPkgEnable("GTK2", "gtk+-2.0")
  1045. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  1046. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  1047. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  1048. if (RTDIST):
  1049. SmartPkgEnable("WX", tool = "wx-config")
  1050. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  1051. if GetTarget() != 'darwin':
  1052. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  1053. if not PkgSkip("NVIDIACG") and not RUNTIME:
  1054. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1055. if not RUNTIME and GetTarget() != "android":
  1056. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1057. if GetHost() != "darwin":
  1058. # Workaround for an issue where pkg-config does not include this path
  1059. if GetTargetArch() in ("x86_64", "amd64"):
  1060. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1061. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1062. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1063. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1064. if not PkgSkip("X11"):
  1065. if (os.path.isdir("/usr/X11R6/lib64")):
  1066. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1067. else:
  1068. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1069. elif not PkgSkip("X11"):
  1070. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1071. if RUNTIME:
  1072. # For the runtime, these packages are required
  1073. for pkg in ["OPENSSL", "ZLIB"]:
  1074. skips = []
  1075. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1076. skips.append(pkg)
  1077. if skips:
  1078. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1079. for pkg in MAYAVERSIONS:
  1080. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1081. if (GetHost() == "darwin"):
  1082. # Sheesh, Autodesk really can't make up their mind
  1083. # regarding the location of the Maya devkit on macOS.
  1084. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1085. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1086. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1087. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1088. if (os.path.isdir(SDK[pkg] + "/lib")):
  1089. LibDirectory(pkg, SDK[pkg] + "/lib")
  1090. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1091. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1092. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1093. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1094. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1095. IncDirectory(pkg, SDK[pkg] + "/include")
  1096. else:
  1097. LibDirectory(pkg, SDK[pkg] + "/lib")
  1098. IncDirectory(pkg, SDK[pkg] + "/include")
  1099. DefSymbol(pkg, "MAYAVERSION", pkg)
  1100. if GetTarget() == 'darwin':
  1101. LibName("ALWAYS", "-framework AppKit")
  1102. LibName("AGL", "-framework AGL")
  1103. LibName("CARBON", "-framework Carbon")
  1104. LibName("COCOA", "-framework Cocoa")
  1105. # Fix for a bug in OSX Leopard:
  1106. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1107. if GetTarget() == 'android':
  1108. LibName("ALWAYS", '-llog')
  1109. LibName("ANDROID", '-landroid')
  1110. LibName("JNIGRAPHICS", '-ljnigraphics')
  1111. for pkg in MAYAVERSIONS:
  1112. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1113. if GetTarget() == 'darwin':
  1114. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1115. else:
  1116. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1117. LibName(pkg, "-lOpenMaya")
  1118. LibName(pkg, "-lOpenMayaAnim")
  1119. LibName(pkg, "-lOpenMayaUI")
  1120. LibName(pkg, "-lAnimSlice")
  1121. LibName(pkg, "-lDeformSlice")
  1122. LibName(pkg, "-lModifiers")
  1123. LibName(pkg, "-lDynSlice")
  1124. LibName(pkg, "-lKinSlice")
  1125. LibName(pkg, "-lModelSlice")
  1126. LibName(pkg, "-lNurbsSlice")
  1127. LibName(pkg, "-lPolySlice")
  1128. LibName(pkg, "-lProjectSlice")
  1129. LibName(pkg, "-lImage")
  1130. LibName(pkg, "-lShared")
  1131. LibName(pkg, "-lTranslators")
  1132. LibName(pkg, "-lDataModel")
  1133. LibName(pkg, "-lRenderModel")
  1134. LibName(pkg, "-lNurbsEngine")
  1135. LibName(pkg, "-lDependEngine")
  1136. LibName(pkg, "-lCommandEngine")
  1137. LibName(pkg, "-lFoundation")
  1138. if pkg not in ("MAYA2020", "MAYA2022"):
  1139. LibName(pkg, "-lIMFbase")
  1140. if GetTarget() != 'darwin':
  1141. LibName(pkg, "-lOpenMayalib")
  1142. else:
  1143. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1144. if (PkgSkip("PHYSX")==0):
  1145. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1146. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1147. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1148. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1149. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1150. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1151. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1152. if (GetHost() == "darwin"):
  1153. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1154. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1155. else:
  1156. LibName("PHYSX", "-lPhysXLoader")
  1157. LibName("PHYSX", "-lNxCharacter")
  1158. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1159. if GetLinkAllStatic():
  1160. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1161. if GetTarget() == 'android':
  1162. DefSymbol("ALWAYS", "ANDROID")
  1163. if not PkgSkip("EIGEN"):
  1164. if GetOptimize() >= 3:
  1165. if COMPILER == "MSVC":
  1166. # Squeeze out a bit more performance on MSVC builds...
  1167. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1168. # will turn them into runtime assertions.
  1169. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1170. if not PkgSkip("EGL"):
  1171. DefSymbol('EGL', 'HAVE_EGL', '')
  1172. if PkgSkip("X11"):
  1173. DefSymbol('EGL', 'EGL_NO_X11', '')
  1174. if not PkgSkip("X11"):
  1175. DefSymbol('X11', 'USE_X11', '')
  1176. ########################################################################
  1177. ##
  1178. ## Give a Status Report on Command-Line Options
  1179. ##
  1180. ########################################################################
  1181. def printStatus(header,warnings):
  1182. if GetVerbose():
  1183. print("")
  1184. print("-------------------------------------------------------------------")
  1185. print(header)
  1186. tkeep = ""
  1187. tomit = ""
  1188. for x in PkgListGet():
  1189. if PkgSkip(x):
  1190. tomit = tomit + x + " "
  1191. else:
  1192. tkeep = tkeep + x + " "
  1193. if RTDIST:
  1194. print("Makepanda: Runtime distribution build")
  1195. elif RUNTIME:
  1196. print("Makepanda: Runtime build")
  1197. else:
  1198. print("Makepanda: Regular build")
  1199. print("Makepanda: Compiler: %s" % (COMPILER))
  1200. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1201. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1202. print("Makepanda: Omit Pkg: %s" % (tomit))
  1203. if GENMAN:
  1204. print("Makepanda: Generate API reference manual")
  1205. else:
  1206. print("Makepanda: Don't generate API reference manual")
  1207. if GetHost() == "windows" and not RTDIST:
  1208. if INSTALLER:
  1209. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1210. else:
  1211. print("Makepanda: Don't build installer")
  1212. print("Makepanda: Version ID: %s" % (VERSION))
  1213. for x in warnings:
  1214. print("Makepanda: %s" % (x))
  1215. print("-------------------------------------------------------------------")
  1216. print("")
  1217. sys.stdout.flush()
  1218. ########################################################################
  1219. ##
  1220. ## BracketNameWithQuotes
  1221. ##
  1222. ########################################################################
  1223. def BracketNameWithQuotes(name):
  1224. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1225. if (name.startswith("-framework")): return name
  1226. if (name.startswith("-dylib_file")): return name
  1227. # Don't add quotes when it's not necessary.
  1228. if " " not in name: return name
  1229. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1230. if (name.startswith('"') and name.endswith('"')): return name
  1231. else: return '"' + name + '"'
  1232. ########################################################################
  1233. ##
  1234. ## CompileCxx
  1235. ##
  1236. ########################################################################
  1237. def CompileCxx(obj,src,opts):
  1238. ipath = GetListOption(opts, "DIR:")
  1239. optlevel = GetOptimizeOption(opts)
  1240. if (COMPILER=="MSVC"):
  1241. if not BOOUSEINTELCOMPILER:
  1242. cmd = "cl "
  1243. if GetTargetArch() == 'x64':
  1244. cmd += "/favor:blend "
  1245. cmd += "/wd4996 /wd4275 /wd4273 "
  1246. # We still target Windows XP.
  1247. cmd += "/DWINVER=0x501 "
  1248. # Work around a WinXP/2003 bug when using VS 2015+.
  1249. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1250. cmd += "/Zc:threadSafeInit- "
  1251. cmd += "/Fo" + obj + " /nologo /c"
  1252. if GetTargetArch() == 'x86':
  1253. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1254. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1255. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1256. else: # x86 without SSE2
  1257. cmd += " /arch:IA32"
  1258. for x in ipath: cmd += " /I" + x
  1259. for (opt,dir) in INCDIRECTORIES:
  1260. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1261. for (opt,var,val) in DEFSYMBOLS:
  1262. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1263. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1264. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1265. if (optlevel==2): cmd += " /MDd /Zi"
  1266. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1267. if (optlevel==4):
  1268. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1269. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1270. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1271. building = GetValueOption(opts, "BUILDING:")
  1272. if (building):
  1273. cmd += " /DBUILDING_" + building
  1274. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1275. cmd += " /bigobj"
  1276. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1277. if 'EXCEPTIONS' in opts:
  1278. cmd += " /EHsc"
  1279. else:
  1280. cmd += " /D_HAS_EXCEPTIONS=0"
  1281. if 'RTTI' not in opts:
  1282. cmd += " /GR-"
  1283. if GetTargetArch() == 'x64':
  1284. cmd += " /DWIN64_VC /DWIN64"
  1285. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1286. # To preserve Windows XP compatibility.
  1287. cmd += " /D_USING_V110_SDK71_"
  1288. cmd += " /W3 " + BracketNameWithQuotes(src)
  1289. oscmd(cmd)
  1290. else:
  1291. cmd = "icl "
  1292. if GetTargetArch() == 'x64':
  1293. cmd += "/favor:blend "
  1294. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1295. cmd += "/DWINVER=0x501 "
  1296. cmd += "/Fo" + obj + " /c"
  1297. for x in ipath: cmd += " /I" + x
  1298. for (opt,dir) in INCDIRECTORIES:
  1299. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1300. for (opt,var,val) in DEFSYMBOLS:
  1301. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1302. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1303. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1304. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1305. # core changes from jean-claude (dec 2011)
  1306. # ----------------------------------------
  1307. # performance will be seeked at level 3 & 4
  1308. # -----------------------------------------
  1309. if (optlevel==3):
  1310. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1311. cmd += " /Ob0"
  1312. cmd += " /Qipo-" # beware of IPO !!!
  1313. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1314. ## ----------------------------------------------------------------
  1315. if (optlevel==4):
  1316. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1317. cmd += " /Qipo" # optimization multi file
  1318. # for 3 & 4 optimization levels
  1319. # -----------------------------
  1320. if (optlevel>=3):
  1321. cmd += " /fp:fast=2"
  1322. cmd += " /Qftz"
  1323. cmd += " /Qfp-speculation:fast"
  1324. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1325. cmd += " /Qprec-div-"
  1326. cmd += " /Qsimd"
  1327. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1328. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1329. cmd += " /Qparallel" # enable parallelization
  1330. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1331. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1332. ## PCH files with a .pchi filename suffix and reduce build time.
  1333. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1334. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1335. cmd += " /Qpchi-" # keep it this way!
  1336. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1337. ## ------------------------------------
  1338. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1339. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1340. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1341. ## Ctor displacement /vd0 : Disable constructor displacement.
  1342. ## Choose this option only if no class constructors or destructors call virtual functions.
  1343. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1344. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1345. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1346. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1347. ## Alternate: #pragma pointers_to_members
  1348. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1349. building = GetValueOption(opts, "BUILDING:")
  1350. if (building): cmd += " /DBUILDING_" + building
  1351. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1352. cmd += " /bigobj"
  1353. # level of warnings and optimization reports
  1354. if GetVerbose():
  1355. cmd += " /W3 " # or /W4 or /Wall
  1356. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1357. else:
  1358. cmd += " /W1 "
  1359. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1360. if GetTargetArch() == 'x64':
  1361. cmd += " /DWIN64_VC /DWIN64"
  1362. cmd += " " + BracketNameWithQuotes(src)
  1363. oscmd(cmd)
  1364. if (COMPILER=="GCC"):
  1365. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1366. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1367. for (opt, dir) in INCDIRECTORIES:
  1368. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1369. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1370. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1371. for (opt,var,val) in DEFSYMBOLS:
  1372. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1373. for x in ipath: cmd += ' -I' + x
  1374. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1375. cmd += ' -fvisibility=hidden'
  1376. # Mac-specific flags.
  1377. if GetTarget() == "darwin":
  1378. cmd += " -Wno-deprecated-declarations"
  1379. if OSXTARGET is not None:
  1380. cmd += " -isysroot " + SDK["MACOSX"]
  1381. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1382. elif platform.mac_ver()[0].startswith('11.'):
  1383. cmd += " -mmacosx-version-min=11.0"
  1384. for arch in OSX_ARCHS:
  1385. if 'NOARCH:' + arch.upper() not in opts:
  1386. cmd += " -arch %s" % arch
  1387. if "SYSROOT" in SDK:
  1388. if GetTarget() != "android":
  1389. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1390. else:
  1391. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1392. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1393. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1394. cmd += ' -no-canonical-prefixes'
  1395. # Android-specific flags.
  1396. arch = GetTargetArch()
  1397. if GetTarget() == "android":
  1398. # Most of the specific optimization flags here were
  1399. # just copied from the default Android Makefiles.
  1400. if "ANDROID_API" in SDK:
  1401. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1402. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1403. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1404. cmd += ' -ffunction-sections -funwind-tables'
  1405. if arch == 'armv7a':
  1406. cmd += ' -target armv7-none-linux-androideabi'
  1407. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1408. cmd += ' -fno-integrated-as'
  1409. elif arch == 'arm':
  1410. cmd += ' -target armv5te-none-linux-androideabi'
  1411. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1412. cmd += ' -fno-integrated-as'
  1413. elif arch == 'aarch64':
  1414. cmd += ' -target aarch64-none-linux-android'
  1415. elif arch == 'mips':
  1416. cmd += ' -target mipsel-none-linux-android'
  1417. cmd += ' -mips32'
  1418. elif arch == 'mips64':
  1419. cmd += ' -target mips64el-none-linux-android'
  1420. cmd += ' -fintegrated-as'
  1421. elif arch == 'x86':
  1422. cmd += ' -target i686-none-linux-android'
  1423. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1424. cmd += ' -mstackrealign'
  1425. elif arch == 'x86_64':
  1426. cmd += ' -target x86_64-none-linux-android'
  1427. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1428. cmd += " -Wa,--noexecstack"
  1429. # Do we want thumb or arm instructions?
  1430. if arch.startswith('arm'):
  1431. if optlevel >= 3:
  1432. cmd += ' -mthumb'
  1433. else:
  1434. cmd += ' -marm'
  1435. # Enable SIMD instructions if requested
  1436. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1437. cmd += ' -mfpu=neon'
  1438. else:
  1439. cmd += " -pthread"
  1440. if not src.endswith(".c"):
  1441. # We don't use exceptions for most modules.
  1442. if 'EXCEPTIONS' in opts:
  1443. cmd += " -fexceptions"
  1444. else:
  1445. cmd += " -fno-exceptions"
  1446. if src.endswith(".mm"):
  1447. # Work around Apple compiler bug.
  1448. cmd += " -U__EXCEPTIONS"
  1449. target = GetTarget()
  1450. if 'RTTI' not in opts and target != "darwin":
  1451. # We always disable RTTI on Android for memory usage reasons.
  1452. if optlevel >= 4 or target == "android":
  1453. cmd += " -fno-rtti"
  1454. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1455. cmd += " -msse2"
  1456. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1457. cmd += " -fno-strict-aliasing"
  1458. # Certain clang versions crash when passing these math flags while
  1459. # compiling Objective-C++ code
  1460. if not src.endswith(".m") and not src.endswith(".mm"):
  1461. if optlevel >= 3:
  1462. cmd += " -ffast-math -fno-stack-protector"
  1463. if optlevel == 3:
  1464. # Fast math is nice, but we'd like to see NaN in dev builds.
  1465. cmd += " -fno-finite-math-only"
  1466. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1467. cmd += " -fno-unsafe-math-optimizations"
  1468. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1469. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1470. if (optlevel==3): cmd += " -O2"
  1471. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1472. # Enable more warnings.
  1473. cmd += " -Wall -Wno-unused-function"
  1474. if not src.endswith(".c"):
  1475. cmd += " -Wno-reorder"
  1476. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1477. if optlevel == 4:
  1478. cmd += " -Wno-unused-variable"
  1479. if src.endswith(".c"):
  1480. cmd += ' ' + CFLAGS
  1481. else:
  1482. cmd += ' ' + CXXFLAGS
  1483. cmd = cmd.rstrip()
  1484. building = GetValueOption(opts, "BUILDING:")
  1485. if (building): cmd += " -DBUILDING_" + building
  1486. cmd += ' ' + BracketNameWithQuotes(src)
  1487. oscmd(cmd)
  1488. ########################################################################
  1489. ##
  1490. ## CompileBison
  1491. ##
  1492. ########################################################################
  1493. def CompileBison(wobj, wsrc, opts):
  1494. ifile = os.path.basename(wsrc)
  1495. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1496. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1497. pre = GetValueOption(opts, "BISONPREFIX_")
  1498. bison = GetBison()
  1499. if bison is None:
  1500. # We don't have bison. See if there is a prebuilt file.
  1501. base, ext = os.path.splitext(wsrc)
  1502. if os.path.isfile(base + '.h.prebuilt') and \
  1503. os.path.isfile(base + '.cxx.prebuilt'):
  1504. CopyFile(wdstc, base + '.cxx.prebuilt')
  1505. CopyFile(wdsth, base + '.h.prebuilt')
  1506. else:
  1507. exit('Could not find bison!')
  1508. else:
  1509. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1510. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1511. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1512. # Finally, compile the generated source file.
  1513. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1514. ########################################################################
  1515. ##
  1516. ## CompileFlex
  1517. ##
  1518. ########################################################################
  1519. def CompileFlex(wobj,wsrc,opts):
  1520. ifile = os.path.basename(wsrc)
  1521. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1522. pre = GetValueOption(opts, "BISONPREFIX_")
  1523. dashi = opts.count("FLEXDASHI")
  1524. flex = GetFlex()
  1525. want_version = GetValueOption(opts, "FLEXVERSION:")
  1526. if flex and want_version:
  1527. # Is flex at the required version for this file?
  1528. want_version = tuple(map(int, want_version.split('.')))
  1529. have_version = GetFlexVersion()
  1530. if want_version > have_version:
  1531. Warn("Skipping flex %s for file %s, need at least %s" % (
  1532. '.'.join(map(str, have_version)),
  1533. ifile,
  1534. '.'.join(map(str, want_version)),
  1535. ))
  1536. flex = None
  1537. if flex is None:
  1538. # We don't have flex. See if there is a prebuilt file.
  1539. base, ext = os.path.splitext(wsrc)
  1540. if os.path.isfile(base + '.cxx.prebuilt'):
  1541. CopyFile(wdst, base + '.cxx.prebuilt')
  1542. else:
  1543. exit('Could not find flex!')
  1544. else:
  1545. if (dashi):
  1546. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1547. else:
  1548. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1549. # Finally, compile the generated source file.
  1550. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1551. ########################################################################
  1552. ##
  1553. ## CompileIgate
  1554. ##
  1555. ########################################################################
  1556. def CompileIgate(woutd,wsrc,opts):
  1557. outbase = os.path.basename(woutd)[:-3]
  1558. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1559. srcdir = GetValueOption(opts, "SRCDIR:")
  1560. module = GetValueOption(opts, "IMOD:")
  1561. library = GetValueOption(opts, "ILIB:")
  1562. ipath = GetListOption(opts, "DIR:")
  1563. if (PkgSkip("PYTHON")):
  1564. WriteFile(woutc, "")
  1565. WriteFile(woutd, "")
  1566. ConditionalWriteFile(woutd, "")
  1567. return
  1568. if not CrossCompiling():
  1569. # If we're compiling for this platform, we can use the one we've built.
  1570. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1571. else:
  1572. # Assume that interrogate is on the PATH somewhere.
  1573. cmd = 'interrogate'
  1574. if GetVerbose():
  1575. cmd += ' -v'
  1576. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1577. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1578. if (COMPILER=="MSVC"):
  1579. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1580. if GetTargetArch() == 'x64':
  1581. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1582. else:
  1583. cmd += ' -D_M_IX86'
  1584. # NOTE: this 1600 value is the version number for VC2010.
  1585. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1586. if (COMPILER=="GCC"):
  1587. cmd += ' -D__attribute__\\(x\\)='
  1588. target_arch = GetTargetArch()
  1589. if target_arch in ("x86_64", "amd64"):
  1590. cmd += ' -D_LP64'
  1591. elif target_arch in ('aarch64', 'arm64'):
  1592. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1593. else:
  1594. cmd += ' -D__i386__'
  1595. target = GetTarget()
  1596. if target == 'darwin':
  1597. cmd += ' -D__APPLE__'
  1598. elif target == 'android':
  1599. cmd += ' -D__ANDROID__'
  1600. optlevel = GetOptimizeOption(opts)
  1601. if (optlevel==1): cmd += ' -D_DEBUG'
  1602. if (optlevel==2): cmd += ' -D_DEBUG'
  1603. if (optlevel==3): pass
  1604. if (optlevel==4): cmd += ' -DNDEBUG'
  1605. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1606. cmd += ' -fnames -string -refcount -assert -python-native'
  1607. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1608. # Add -I, -S and -D flags
  1609. for x in ipath:
  1610. cmd += ' -I' + BracketNameWithQuotes(x)
  1611. for (opt,dir) in INCDIRECTORIES:
  1612. if (opt=="ALWAYS") or (opt in opts):
  1613. cmd += ' -S' + BracketNameWithQuotes(dir)
  1614. for (opt,var,val) in DEFSYMBOLS:
  1615. if (opt=="ALWAYS") or (opt in opts):
  1616. cmd += ' -D' + var + '=' + val
  1617. #building = GetValueOption(opts, "BUILDING:")
  1618. #if (building): cmd += " -DBUILDING_"+building
  1619. cmd += ' -module ' + module + ' -library ' + library
  1620. for x in wsrc:
  1621. if (x.startswith("/")):
  1622. cmd += ' ' + BracketNameWithQuotes(x)
  1623. else:
  1624. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1625. oscmd(cmd)
  1626. ########################################################################
  1627. ##
  1628. ## CompileImod
  1629. ##
  1630. ########################################################################
  1631. def CompileImod(wobj, wsrc, opts):
  1632. module = GetValueOption(opts, "IMOD:")
  1633. library = GetValueOption(opts, "ILIB:")
  1634. if (COMPILER=="MSVC"):
  1635. woutc = wobj[:-4]+".cxx"
  1636. if (COMPILER=="GCC"):
  1637. woutc = wobj[:-2]+".cxx"
  1638. if (PkgSkip("PYTHON")):
  1639. WriteFile(woutc, "")
  1640. CompileCxx(wobj, woutc, opts)
  1641. return
  1642. if not CrossCompiling():
  1643. # If we're compiling for this platform, we can use the one we've built.
  1644. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1645. else:
  1646. # Assume that interrogate_module is on the PATH somewhere.
  1647. cmd = 'interrogate_module'
  1648. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1649. importmod = GetValueOption(opts, "IMPORT:")
  1650. if importmod:
  1651. cmd += ' -import ' + importmod
  1652. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1653. oscmd(cmd)
  1654. CompileCxx(wobj,woutc,opts)
  1655. return
  1656. ########################################################################
  1657. ##
  1658. ## CompileLib
  1659. ##
  1660. ########################################################################
  1661. def CompileLib(lib, obj, opts):
  1662. if (COMPILER=="MSVC"):
  1663. if not BOOUSEINTELCOMPILER:
  1664. #Use MSVC Linker
  1665. cmd = 'link /lib /nologo'
  1666. if GetOptimizeOption(opts) == 4:
  1667. cmd += " /LTCG"
  1668. if HasTargetArch():
  1669. cmd += " /MACHINE:" + GetTargetArch().upper()
  1670. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1671. for x in obj:
  1672. if not x.endswith('.lib'):
  1673. cmd += ' ' + BracketNameWithQuotes(x)
  1674. oscmd(cmd)
  1675. else:
  1676. # Choose Intel linker; from Jean-Claude
  1677. cmd = 'xilink /verbose:lib /lib '
  1678. if HasTargetArch():
  1679. cmd += " /MACHINE:" + GetTargetArch().upper()
  1680. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1681. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1682. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1683. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1684. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1685. oscmd(cmd)
  1686. if (COMPILER=="GCC"):
  1687. if GetTarget() == 'darwin':
  1688. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1689. else:
  1690. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1691. for x in obj:
  1692. if GetLinkAllStatic() and x.endswith('.a'):
  1693. continue
  1694. cmd += ' ' + BracketNameWithQuotes(x)
  1695. oscmd(cmd)
  1696. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1697. ########################################################################
  1698. ##
  1699. ## CompileLink
  1700. ##
  1701. ########################################################################
  1702. def CompileLink(dll, obj, opts):
  1703. if (COMPILER=="MSVC"):
  1704. if not BOOUSEINTELCOMPILER:
  1705. cmd = "link /nologo "
  1706. if HasTargetArch():
  1707. cmd += " /MACHINE:" + GetTargetArch().upper()
  1708. if ("MFC" not in opts):
  1709. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1710. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1711. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1712. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1713. optlevel = GetOptimizeOption(opts)
  1714. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1715. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1716. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1717. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1718. if ("MFC" in opts):
  1719. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1720. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1721. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1722. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1723. if not PkgSkip("PYTHON"):
  1724. # If we're building without Python, don't pick it up implicitly.
  1725. if "PYTHON" not in opts:
  1726. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1727. if optlevel <= 2:
  1728. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1729. else:
  1730. cmd += ' /NOD:{}.lib'.format(pythonv)
  1731. # Yes, we know we are importing "locally defined symbols".
  1732. for x in obj:
  1733. if x.endswith('libp3pystub.lib'):
  1734. cmd += ' /ignore:4049,4217'
  1735. break
  1736. # Set the subsystem. Specify that we want to target Windows XP.
  1737. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1738. cmd += " /SUBSYSTEM:" + subsystem
  1739. if GetTargetArch() == 'x64':
  1740. cmd += ",5.02"
  1741. else:
  1742. cmd += ",5.01"
  1743. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1744. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1745. for (opt, dir) in LIBDIRECTORIES:
  1746. if (opt=="ALWAYS") or (opt in opts):
  1747. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1748. for x in obj:
  1749. if x.endswith(".dll") or x.endswith(".pyd"):
  1750. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1751. elif x.endswith(".lib"):
  1752. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1753. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1754. exit("Error: in makepanda, specify "+dname+", not "+x)
  1755. cmd += ' ' + BracketNameWithQuotes(x)
  1756. elif x.endswith(".def"):
  1757. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1758. elif x.endswith(".dat"):
  1759. pass
  1760. else:
  1761. cmd += ' ' + BracketNameWithQuotes(x)
  1762. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1763. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1764. for (opt, name) in LIBNAMES:
  1765. if (opt=="ALWAYS") or (opt in opts):
  1766. cmd += " " + BracketNameWithQuotes(name)
  1767. oscmd(cmd)
  1768. else:
  1769. cmd = "xilink"
  1770. if GetVerbose(): cmd += " /verbose:lib"
  1771. if HasTargetArch():
  1772. cmd += " /MACHINE:" + GetTargetArch().upper()
  1773. if ("MFC" not in opts):
  1774. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1775. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1776. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1777. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1778. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1779. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1780. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1781. optlevel = GetOptimizeOption(opts)
  1782. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1783. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1784. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1785. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1786. if ("MFC" in opts):
  1787. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1788. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1789. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1790. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1791. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1792. if subsystem:
  1793. cmd += " /SUBSYSTEM:" + subsystem
  1794. if dll.endswith(".dll"):
  1795. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1796. for (opt, dir) in LIBDIRECTORIES:
  1797. if (opt=="ALWAYS") or (opt in opts):
  1798. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1799. for x in obj:
  1800. if x.endswith(".dll") or x.endswith(".pyd"):
  1801. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1802. elif x.endswith(".lib"):
  1803. dname = os.path.splitext(dll)[0]+".dll"
  1804. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1805. exit("Error: in makepanda, specify "+dname+", not "+x)
  1806. cmd += ' ' + BracketNameWithQuotes(x)
  1807. elif x.endswith(".def"):
  1808. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1809. elif x.endswith(".dat"):
  1810. pass
  1811. else:
  1812. cmd += ' ' + BracketNameWithQuotes(x)
  1813. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1814. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1815. for (opt, name) in LIBNAMES:
  1816. if (opt=="ALWAYS") or (opt in opts):
  1817. cmd += " " + BracketNameWithQuotes(name)
  1818. oscmd(cmd)
  1819. if COMPILER == "GCC":
  1820. cxx = GetCXX()
  1821. if GetOrigExt(dll) == ".exe":
  1822. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1823. if GetTarget() == "android":
  1824. # Necessary to work around an issue with libandroid depending on vendor libraries
  1825. cmd += ' -Wl,--allow-shlib-undefined'
  1826. else:
  1827. if (GetTarget() == "darwin"):
  1828. cmd = cxx + ' -undefined dynamic_lookup'
  1829. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1830. cmd += ' -bundle '
  1831. else:
  1832. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1833. cmd += ' -dynamiclib -install_name ' + install_name
  1834. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1835. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1836. else:
  1837. cmd = cxx + ' -shared'
  1838. # Always set soname on Android to avoid a linker warning when loading the library.
  1839. if "MODULE" not in opts or GetTarget() == 'android':
  1840. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1841. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1842. for x in obj:
  1843. if GetOrigExt(x) != ".dat":
  1844. cmd += ' ' + x
  1845. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1846. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1847. # macOS specific flags.
  1848. if GetTarget() == 'darwin':
  1849. cmd += " -headerpad_max_install_names"
  1850. if OSXTARGET is not None:
  1851. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1852. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1853. elif platform.mac_ver()[0].startswith('11.'):
  1854. cmd += " -mmacosx-version-min=11.0"
  1855. for arch in OSX_ARCHS:
  1856. if 'NOARCH:' + arch.upper() not in opts:
  1857. cmd += " -arch %s" % arch
  1858. elif GetTarget() == 'android':
  1859. arch = GetTargetArch()
  1860. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1861. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1862. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1863. if arch == 'armv7a':
  1864. cmd += ' -target armv7-none-linux-androideabi'
  1865. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1866. elif arch == 'arm':
  1867. cmd += ' -target armv5te-none-linux-androideabi'
  1868. elif arch == 'aarch64':
  1869. cmd += ' -target aarch64-none-linux-android'
  1870. elif arch == 'mips':
  1871. cmd += ' -target mipsel-none-linux-android'
  1872. cmd += ' -mips32'
  1873. elif arch == 'mips64':
  1874. cmd += ' -target mips64el-none-linux-android'
  1875. elif arch == 'x86':
  1876. cmd += ' -target i686-none-linux-android'
  1877. elif arch == 'x86_64':
  1878. cmd += ' -target x86_64-none-linux-android'
  1879. cmd += ' -lc -lm'
  1880. else:
  1881. cmd += " -pthread"
  1882. if "SYSROOT" in SDK:
  1883. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1884. if LDFLAGS != "":
  1885. cmd += " " + LDFLAGS
  1886. # Don't link libraries with Python, except on Android.
  1887. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1888. opts = opts[:]
  1889. opts.remove("PYTHON")
  1890. for (opt, dir) in LIBDIRECTORIES:
  1891. if (opt=="ALWAYS") or (opt in opts):
  1892. cmd += ' -L' + BracketNameWithQuotes(dir)
  1893. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1894. if (opt=="ALWAYS") or (opt in opts):
  1895. cmd += ' -F' + BracketNameWithQuotes(dir)
  1896. for (opt, name) in LIBNAMES:
  1897. if (opt=="ALWAYS") or (opt in opts):
  1898. cmd += ' ' + BracketNameWithQuotes(name)
  1899. if GetTarget() != 'freebsd':
  1900. cmd += " -ldl"
  1901. oscmd(cmd)
  1902. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1903. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1904. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1905. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1906. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1907. if os.path.isfile(newdll):
  1908. os.remove(newdll)
  1909. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1910. elif dll.endswith("." + MAJOR_VERSION):
  1911. newdll = dll[:-len(MAJOR_VERSION)-1]
  1912. if os.path.isfile(newdll):
  1913. os.remove(newdll)
  1914. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1915. ##########################################################################################
  1916. #
  1917. # CompileEgg
  1918. #
  1919. ##########################################################################################
  1920. def CompileEgg(eggfile, src, opts):
  1921. pz = False
  1922. if eggfile.endswith(".pz"):
  1923. pz = True
  1924. eggfile = eggfile[:-3]
  1925. # Determine the location of the pzip and flt2egg tools.
  1926. if CrossCompiling():
  1927. # We may not be able to use our generated versions of these tools,
  1928. # so we'll expect them to already be present in the PATH.
  1929. pzip = 'pzip'
  1930. flt2egg = 'flt2egg'
  1931. else:
  1932. # If we're compiling for this machine, we can use the binaries we've built.
  1933. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1934. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1935. if not os.path.isfile(pzip):
  1936. pzip = 'pzip'
  1937. if not os.path.isfile(flt2egg):
  1938. flt2egg = 'flt2egg'
  1939. if src.endswith(".egg"):
  1940. CopyFile(eggfile, src)
  1941. elif src.endswith(".flt"):
  1942. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1943. if pz:
  1944. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1945. ##########################################################################################
  1946. #
  1947. # CompileRes, CompileRsrc
  1948. #
  1949. ##########################################################################################
  1950. def CompileRes(target, src, opts):
  1951. """Compiles a Windows .rc file into a .res file."""
  1952. ipath = GetListOption(opts, "DIR:")
  1953. if (COMPILER == "MSVC"):
  1954. cmd = "rc"
  1955. cmd += " /Fo" + BracketNameWithQuotes(target)
  1956. for x in ipath: cmd += " /I" + x
  1957. for (opt,dir) in INCDIRECTORIES:
  1958. if (opt=="ALWAYS") or (opt in opts):
  1959. cmd += " /I" + BracketNameWithQuotes(dir)
  1960. for (opt,var,val) in DEFSYMBOLS:
  1961. if (opt=="ALWAYS") or (opt in opts):
  1962. cmd += " /D" + var + "=" + val
  1963. cmd += " " + BracketNameWithQuotes(src)
  1964. else:
  1965. cmd = "windres"
  1966. for x in ipath: cmd += " -I" + x
  1967. for (opt,dir) in INCDIRECTORIES:
  1968. if (opt=="ALWAYS") or (opt in opts):
  1969. cmd += " -I" + BracketNameWithQuotes(dir)
  1970. for (opt,var,val) in DEFSYMBOLS:
  1971. if (opt=="ALWAYS") or (opt in opts):
  1972. cmd += " -D" + var + "=" + val
  1973. cmd += " -i " + BracketNameWithQuotes(src)
  1974. cmd += " -o " + BracketNameWithQuotes(target)
  1975. oscmd(cmd)
  1976. def CompileRsrc(target, src, opts):
  1977. """Compiles a Mac OS .r file into an .rsrc file."""
  1978. ipath = GetListOption(opts, "DIR:")
  1979. if os.path.isfile("/usr/bin/Rez"):
  1980. cmd = "Rez -useDF"
  1981. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1982. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1983. else:
  1984. cmd = "/Developer/Tools/Rez -useDF"
  1985. cmd += " -o " + BracketNameWithQuotes(target)
  1986. for x in ipath:
  1987. cmd += " -i " + x
  1988. for (opt,dir) in INCDIRECTORIES:
  1989. if (opt=="ALWAYS") or (opt in opts):
  1990. cmd += " -i " + BracketNameWithQuotes(dir)
  1991. for (opt,var,val) in DEFSYMBOLS:
  1992. if (opt=="ALWAYS") or (opt in opts):
  1993. if (val == ""):
  1994. cmd += " -d " + var
  1995. else:
  1996. cmd += " -d " + var + " = " + val
  1997. cmd += " " + BracketNameWithQuotes(src)
  1998. oscmd(cmd)
  1999. ##########################################################################################
  2000. #
  2001. # CompileJava (Android only)
  2002. #
  2003. ##########################################################################################
  2004. def CompileJava(target, src, opts):
  2005. """Compiles a .java file into a .class file."""
  2006. if GetHost() == 'android':
  2007. cmd = "ecj "
  2008. else:
  2009. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  2010. optlevel = GetOptimizeOption(opts)
  2011. if optlevel >= 4:
  2012. cmd += "-debug:none "
  2013. cmd += "-cp " + GetOutputDir() + "/classes "
  2014. cmd += "-d " + GetOutputDir() + "/classes "
  2015. cmd += BracketNameWithQuotes(src)
  2016. oscmd(cmd)
  2017. ##########################################################################################
  2018. #
  2019. # FreezePy
  2020. #
  2021. ##########################################################################################
  2022. def FreezePy(target, inputs, opts):
  2023. assert len(inputs) > 0
  2024. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  2025. if sys.version_info >= (2, 6):
  2026. cmdstr += "-B "
  2027. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  2028. if 'FREEZE_STARTUP' in opts:
  2029. cmdstr += " -s"
  2030. if GetOrigExt(target) == '.exe':
  2031. src = inputs.pop(0)
  2032. else:
  2033. src = ""
  2034. for i in inputs:
  2035. i = os.path.splitext(i)[0]
  2036. i = i.replace('/', '.')
  2037. if i.startswith('direct.src'):
  2038. i = i.replace('.src.', '.')
  2039. cmdstr += " -i " + i
  2040. cmdstr += " -o " + target + " " + src
  2041. if ("LINK_PYTHON_STATIC" in opts):
  2042. os.environ["LINK_PYTHON_STATIC"] = "1"
  2043. oscmd(cmdstr)
  2044. if ("LINK_PYTHON_STATIC" in os.environ):
  2045. del os.environ["LINK_PYTHON_STATIC"]
  2046. if (not os.path.exists(target)):
  2047. exit("FREEZER_ERROR")
  2048. ##########################################################################################
  2049. #
  2050. # Package
  2051. #
  2052. ##########################################################################################
  2053. def Package(target, inputs, opts):
  2054. assert len(inputs) == 1
  2055. # Invoke the ppackage script.
  2056. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  2057. if GetOptimizeOption(opts) >= 4:
  2058. command += "-OO "
  2059. if sys.version_info >= (2, 6):
  2060. command += "-B "
  2061. command += "direct/src/p3d/ppackage.py"
  2062. if not RTDIST:
  2063. # Don't compile Python sources, because we might not running in the same
  2064. # Python version as the selected host.
  2065. command += " -N"
  2066. if GetTarget() == "darwin":
  2067. if SDK.get("MACOSX"):
  2068. command += " -R \"%s\"" % SDK["MACOSX"]
  2069. for arch in OSX_ARCHS:
  2070. if arch == "x86_64":
  2071. arch = "amd64"
  2072. command += " -P osx_%s" % arch
  2073. command += " -i \"" + GetOutputDir() + "/stage\""
  2074. if (P3DSUFFIX):
  2075. command += ' -a "' + P3DSUFFIX + '"'
  2076. command += " " + inputs[0]
  2077. if GetOrigExt(target) == '.p3d':
  2078. # Build a specific .p3d file.
  2079. basename = os.path.basename(os.path.splitext(target)[0])
  2080. command += " " + basename
  2081. oscmd(command)
  2082. if GetTarget() == 'windows':
  2083. # Make an .exe that calls this .p3d.
  2084. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2085. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2086. exefile = FindLocation(basename + '.exe', [])
  2087. CompileLink(exefile, [objfile], ['ADVAPI'])
  2088. # Move it to the bin directory.
  2089. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2090. if sys.platform != 'win32':
  2091. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2092. else:
  2093. # This is presumably a package or set of packages.
  2094. oscmd(command)
  2095. ##########################################################################################
  2096. #
  2097. # CompileBundle
  2098. #
  2099. ##########################################################################################
  2100. def CompileBundle(target, inputs, opts):
  2101. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2102. plist = None
  2103. resources = []
  2104. objects = []
  2105. for i in inputs:
  2106. if (i.endswith(".plist")):
  2107. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2108. plist = i
  2109. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2110. resources.append(i)
  2111. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2112. objects.append(i)
  2113. else:
  2114. exit("Don't know how to bundle file %s" % i)
  2115. # Now link the object files to form the bundle.
  2116. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2117. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2118. oscmd("rm -rf %s" % target)
  2119. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2120. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2121. if target.endswith(".app"):
  2122. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2123. else:
  2124. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2125. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2126. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2127. for r in resources:
  2128. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2129. ##########################################################################################
  2130. #
  2131. # CompileMIDL
  2132. #
  2133. ##########################################################################################
  2134. def CompileMIDL(target, src, opts):
  2135. ipath = GetListOption(opts, "DIR:")
  2136. if (COMPILER=="MSVC"):
  2137. cmd = "midl"
  2138. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2139. for x in ipath: cmd += " /I" + x
  2140. for (opt,dir) in INCDIRECTORIES:
  2141. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2142. for (opt,var,val) in DEFSYMBOLS:
  2143. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2144. cmd += " " + BracketNameWithQuotes(src)
  2145. oscmd(cmd)
  2146. ##########################################################################################
  2147. #
  2148. # CompileAnything
  2149. #
  2150. ##########################################################################################
  2151. def CompileAnything(target, inputs, opts, progress = None):
  2152. if (opts.count("DEPENDENCYONLY")):
  2153. return
  2154. if (len(inputs)==0):
  2155. exit("No input files for target "+target)
  2156. infile = inputs[0]
  2157. origsuffix = GetOrigExt(target)
  2158. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2159. # It must be a simple copy operation.
  2160. ProgressOutput(progress, "Copying file", target)
  2161. CopyFile(target, infile)
  2162. if (origsuffix==".exe" and GetHost() != "windows"):
  2163. os.system("chmod +x \"%s\"" % target)
  2164. return
  2165. elif (infile.endswith(".py")):
  2166. if origsuffix == ".obj":
  2167. source = os.path.splitext(target)[0] + ".c"
  2168. SetOrigExt(source, ".c")
  2169. ProgressOutput(progress, "Building frozen source", source)
  2170. FreezePy(source, inputs, opts)
  2171. ProgressOutput(progress, "Building C++ object", target)
  2172. return CompileCxx(target, source, opts)
  2173. if origsuffix == ".exe":
  2174. ProgressOutput(progress, "Building frozen executable", target)
  2175. else:
  2176. ProgressOutput(progress, "Building frozen library", target)
  2177. return FreezePy(target, inputs, opts)
  2178. elif (infile.endswith(".idl")):
  2179. ProgressOutput(progress, "Compiling MIDL file", infile)
  2180. return CompileMIDL(target, infile, opts)
  2181. elif (infile.endswith(".pdef")):
  2182. if origsuffix == '.p3d':
  2183. ProgressOutput(progress, "Building package", target)
  2184. else:
  2185. ProgressOutput(progress, "Building package from pdef file", infile)
  2186. return Package(target, inputs, opts)
  2187. elif origsuffix in SUFFIX_LIB:
  2188. ProgressOutput(progress, "Linking static library", target)
  2189. return CompileLib(target, inputs, opts)
  2190. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2191. if (origsuffix==".exe"):
  2192. ProgressOutput(progress, "Linking executable", target)
  2193. else:
  2194. ProgressOutput(progress, "Linking dynamic library", target)
  2195. # Add version number to the dynamic library, on unix
  2196. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2197. tplatform = GetTarget()
  2198. if tplatform == "darwin":
  2199. # On Mac, libraries are named like libpanda.1.2.dylib
  2200. if target.lower().endswith(".dylib"):
  2201. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2202. SetOrigExt(target, origsuffix)
  2203. elif tplatform != "windows" and tplatform != "android":
  2204. # On Linux, libraries are named like libpanda.so.1.2
  2205. target += "." + MAJOR_VERSION
  2206. SetOrigExt(target, origsuffix)
  2207. return CompileLink(target, inputs, opts)
  2208. elif (origsuffix==".in"):
  2209. ProgressOutput(progress, "Building Interrogate database", target)
  2210. return CompileIgate(target, inputs, opts)
  2211. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2212. ProgressOutput(progress, "Building plugin bundle", target)
  2213. return CompileBundle(target, inputs, opts)
  2214. elif (origsuffix==".app"):
  2215. ProgressOutput(progress, "Building application bundle", target)
  2216. return CompileBundle(target, inputs, opts)
  2217. elif (origsuffix==".pz"):
  2218. ProgressOutput(progress, "Compressing", target)
  2219. return CompileEgg(target, infile, opts)
  2220. elif (origsuffix==".egg"):
  2221. ProgressOutput(progress, "Converting", target)
  2222. return CompileEgg(target, infile, opts)
  2223. elif (origsuffix==".res"):
  2224. ProgressOutput(progress, "Building resource object", target)
  2225. return CompileRes(target, infile, opts)
  2226. elif (origsuffix==".rsrc"):
  2227. ProgressOutput(progress, "Building resource object", target)
  2228. return CompileRsrc(target, infile, opts)
  2229. elif (origsuffix==".class"):
  2230. ProgressOutput(progress, "Building Java class", target)
  2231. return CompileJava(target, infile, opts)
  2232. elif (origsuffix==".obj"):
  2233. if (infile.endswith(".cxx")):
  2234. ProgressOutput(progress, "Building C++ object", target)
  2235. return CompileCxx(target, infile, opts)
  2236. elif (infile.endswith(".c")):
  2237. ProgressOutput(progress, "Building C object", target)
  2238. return CompileCxx(target, infile, opts)
  2239. elif (infile.endswith(".mm")):
  2240. ProgressOutput(progress, "Building Objective-C++ object", target)
  2241. return CompileCxx(target, infile, opts)
  2242. elif (infile.endswith(".yxx")):
  2243. ProgressOutput(progress, "Building Bison object", target)
  2244. return CompileBison(target, infile, opts)
  2245. elif (infile.endswith(".lxx")):
  2246. ProgressOutput(progress, "Building Flex object", target)
  2247. return CompileFlex(target, infile, opts)
  2248. elif (infile.endswith(".in")):
  2249. ProgressOutput(progress, "Building Interrogate object", target)
  2250. return CompileImod(target, inputs, opts)
  2251. elif (infile.endswith(".rc")):
  2252. ProgressOutput(progress, "Building resource object", target)
  2253. return CompileRes(target, infile, opts)
  2254. elif (infile.endswith(".r")):
  2255. ProgressOutput(progress, "Building resource object", target)
  2256. return CompileRsrc(target, infile, opts)
  2257. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2258. ##########################################################################################
  2259. #
  2260. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2261. #
  2262. ##########################################################################################
  2263. DTOOL_CONFIG=[
  2264. #_Variable_________________________Windows___________________Unix__________
  2265. ("HAVE_PYTHON", '1', '1'),
  2266. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2267. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2268. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2269. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2270. ("HAVE_MAYA", '1', '1'),
  2271. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2272. ("USE_PANDAFILESTREAM", '1', '1'),
  2273. ("USE_DELETED_CHAIN", '1', '1'),
  2274. ("HAVE_WGL", '1', 'UNDEF'),
  2275. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2276. ("HAVE_THREADS", '1', '1'),
  2277. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2278. ("OS_SIMPLE_THREADS", '1', '1'),
  2279. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2280. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2281. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2282. ("HAVE_AUDIO", '1', '1'),
  2283. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2284. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2285. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2286. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2287. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2288. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2289. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2290. ("DO_PIPELINING", '1', '1'),
  2291. ("DEFAULT_PATHSEP", '";"', '":"'),
  2292. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2293. ("PHAVE_LOCKF", '1', '1'),
  2294. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2295. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2296. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2297. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2298. ("HAVE_GETOPT", 'UNDEF', '1'),
  2299. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2300. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2301. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2302. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2303. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2304. ("HAVE_IOS_BINARY", '1', '1'),
  2305. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2306. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2307. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2308. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2309. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2310. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2311. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2312. ("HAVE_PROC_CURPROC_CMDLINE", 'UNDEF', 'UNDEF'),
  2313. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2314. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2315. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2316. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2317. ("PHAVE_IO_H", '1', 'UNDEF'),
  2318. ("PHAVE_IOSTREAM", '1', '1'),
  2319. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2320. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2321. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2322. ("PHAVE_MALLOC_H", '1', '1'),
  2323. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2324. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2325. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2326. ("PHAVE_SSTREAM", '1', '1'),
  2327. ("PHAVE_NEW", '1', '1'),
  2328. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2329. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2330. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2331. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2332. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2333. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2334. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2335. ("PHAVE_STDINT_H", '1', '1'),
  2336. ("HAVE_RTTI", '1', '1'),
  2337. ("HAVE_X11", 'UNDEF', '1'),
  2338. ("IS_LINUX", 'UNDEF', '1'),
  2339. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2340. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2341. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2342. ("LINMATH_ALIGN", '1', '1'),
  2343. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2344. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2345. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2346. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2347. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2348. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2349. ("HAVE_SGI_RGB", '1', '1'),
  2350. ("HAVE_TGA", '1', '1'),
  2351. ("HAVE_IMG", '1', '1'),
  2352. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2353. ("HAVE_BMP", '1', '1'),
  2354. ("HAVE_PNM", '1', '1'),
  2355. ("HAVE_STB_IMAGE", '1', '1'),
  2356. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2357. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2358. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2359. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2360. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2361. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2362. ("WANT_NATIVE_NET", '1', '1'),
  2363. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2364. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2365. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2366. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2367. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2368. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2369. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2370. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2371. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2372. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2373. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2374. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2375. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2376. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2377. # ("_SECURE_SCL", '0', 'UNDEF'),
  2378. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2379. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2380. ]
  2381. PRC_PARAMETERS=[
  2382. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2383. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2384. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2385. ("PRC_PATH2_ENVVARS", '""', '""'),
  2386. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2387. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2388. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2389. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2390. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2391. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2392. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2393. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2394. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2395. ]
  2396. def WriteConfigSettings():
  2397. dtool_config={}
  2398. prc_parameters={}
  2399. speedtree_parameters={}
  2400. plugin_config={}
  2401. if (GetTarget() == 'windows'):
  2402. for key,win,unix in DTOOL_CONFIG:
  2403. dtool_config[key] = win
  2404. for key,win,unix in PRC_PARAMETERS:
  2405. prc_parameters[key] = win
  2406. else:
  2407. for key,win,unix in DTOOL_CONFIG:
  2408. dtool_config[key] = unix
  2409. for key,win,unix in PRC_PARAMETERS:
  2410. prc_parameters[key] = unix
  2411. for x in PkgListGet():
  2412. if ("HAVE_"+x in dtool_config):
  2413. if (PkgSkip(x)==0):
  2414. dtool_config["HAVE_"+x] = '1'
  2415. else:
  2416. dtool_config["HAVE_"+x] = 'UNDEF'
  2417. dtool_config["HAVE_NET"] = '1'
  2418. if (PkgSkip("NVIDIACG")==0):
  2419. dtool_config["HAVE_CG"] = '1'
  2420. dtool_config["HAVE_CGGL"] = '1'
  2421. dtool_config["HAVE_CGDX9"] = '1'
  2422. if GetTarget() not in ("linux", "android"):
  2423. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2424. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2425. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2426. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2427. if (GetTarget() == "darwin"):
  2428. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2429. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2430. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2431. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2432. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2433. dtool_config["IS_LINUX"] = 'UNDEF'
  2434. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2435. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2436. dtool_config["IS_OSX"] = '1'
  2437. if (GetTarget() == "freebsd"):
  2438. dtool_config["IS_LINUX"] = 'UNDEF'
  2439. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2440. dtool_config["IS_FREEBSD"] = '1'
  2441. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2442. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2443. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2444. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2445. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2446. if (GetTarget() == "android"):
  2447. # Android does have RTTI, but we disable it anyway.
  2448. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2449. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2450. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2451. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2452. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2453. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2454. # This should probably be more sophisticated, such as based
  2455. # on whether the libRocket Python modules are available.
  2456. if (PkgSkip("PYTHON") != 0):
  2457. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2458. if (GetOptimize() <= 3):
  2459. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2460. if (GetOptimize() <= 3):
  2461. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2462. dtool_config["DO_PSTATS"] = '1'
  2463. if (GetOptimize() <= 3):
  2464. dtool_config["DO_DCAST"] = '1'
  2465. if (GetOptimize() <= 3):
  2466. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2467. if (GetOptimize() <= 3):
  2468. dtool_config["DO_MEMORY_USAGE"] = '1'
  2469. if (GetOptimize() <= 3):
  2470. dtool_config["NOTIFY_DEBUG"] = '1'
  2471. if (GetOptimize() >= 4):
  2472. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2473. if (GetOptimize() >= 4):
  2474. # Disable RTTI on release builds.
  2475. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2476. # Now that we have OS_SIMPLE_THREADS, we can support
  2477. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2478. # longer need to disable it for this platform.
  2479. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2480. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2481. if (RTDIST or RUNTIME):
  2482. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2483. if HOST_URL:
  2484. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2485. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2486. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2487. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2488. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2489. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2490. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2491. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2492. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2493. if PkgSkip("GTK2") == 0:
  2494. plugin_config["HAVE_GTK"] = '1'
  2495. if (RUNTIME):
  2496. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2497. # Whether it's present on the system doesn't matter here,
  2498. # as the runtime itself doesn't include or link with X11.
  2499. if (RUNTIME and GetTarget() == 'linux'):
  2500. dtool_config["HAVE_X11"] = '1'
  2501. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2502. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2503. else:
  2504. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2505. if (PkgSkip("SPEEDTREE")==0):
  2506. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2507. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2508. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2509. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2510. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2511. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2512. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2513. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2514. for key in sorted(prc_parameters.keys()):
  2515. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2516. val = OverrideValue(key, prc_parameters[key])
  2517. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2518. else: conf = conf + "#define " + key + " " + val + "\n"
  2519. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2520. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2521. for key in sorted(dtool_config.keys()):
  2522. val = OverrideValue(key, dtool_config[key])
  2523. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2524. # These are not available for ARM, period.
  2525. conf = conf + "#ifdef __aarch64__\n"
  2526. conf = conf + "#undef " + key + "\n"
  2527. conf = conf + "#else\n"
  2528. conf = conf + "#define " + key + " " + val + "\n"
  2529. conf = conf + "#endif\n"
  2530. elif val == 'UNDEF':
  2531. conf = conf + "#undef " + key + "\n"
  2532. else:
  2533. conf = conf + "#define " + key + " " + val + "\n"
  2534. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2535. if (RTDIST or RUNTIME):
  2536. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2537. for key in sorted(plugin_config.keys()):
  2538. val = plugin_config[key]
  2539. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2540. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2541. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2542. if (PkgSkip("SPEEDTREE")==0):
  2543. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2544. for key in sorted(speedtree_parameters.keys()):
  2545. val = OverrideValue(key, speedtree_parameters[key])
  2546. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2547. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2548. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2549. for x in PkgListGet():
  2550. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2551. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2552. # Finally, write a platform.dat with the platform we are compiling for.
  2553. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2554. # This is useful for tools like makepackage that need to know things about
  2555. # the build parameters.
  2556. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2557. WriteConfigSettings()
  2558. WarnConflictingFiles()
  2559. if SystemLibraryExists("dtoolbase"):
  2560. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2561. if SystemLibraryExists("p3dtoolconfig"):
  2562. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2563. ##########################################################################################
  2564. #
  2565. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2566. #
  2567. ##########################################################################################
  2568. PANDAVERSION_H="""
  2569. #define PANDA_MAJOR_VERSION $VERSION1
  2570. #define PANDA_MINOR_VERSION $VERSION2
  2571. #define PANDA_SEQUENCE_VERSION $VERSION3
  2572. #define PANDA_VERSION $NVERSION
  2573. #define PANDA_NUMERIC_VERSION $NVERSION
  2574. #define PANDA_VERSION_STR "$VERSION"
  2575. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2576. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2577. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2578. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2579. """
  2580. PANDAVERSION_H_RUNTIME="""
  2581. #define PANDA_MAJOR_VERSION 0
  2582. #define PANDA_MINOR_VERSION 0
  2583. #define PANDA_SEQUENCE_VERSION 0
  2584. #define PANDA_VERSION_STR "0.0.0"
  2585. #define PANDA_ABI_VERSION_STR "0.0"
  2586. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2587. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2588. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2589. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2590. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2591. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2592. #define PANDA_PACKAGE_VERSION_STR ""
  2593. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2594. """
  2595. CHECKPANDAVERSION_CXX="""
  2596. # include "dtoolbase.h"
  2597. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2598. """
  2599. CHECKPANDAVERSION_H="""
  2600. # ifndef CHECKPANDAVERSION_H
  2601. # define CHECKPANDAVERSION_H
  2602. # include "dtoolbase.h"
  2603. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2604. // Hack to forcibly depend on the check
  2605. template<typename T>
  2606. class CheckPandaVersion {
  2607. public:
  2608. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2609. };
  2610. template class CheckPandaVersion<void>;
  2611. # endif
  2612. """
  2613. P3DACTIVEX_RC="""#include "resource.h"
  2614. #define APSTUDIO_READONLY_SYMBOLS
  2615. #include "afxres.h"
  2616. #undef APSTUDIO_READONLY_SYMBOLS
  2617. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2618. #ifdef _WIN32
  2619. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2620. #pragma code_page(1252)
  2621. #endif
  2622. #ifdef APSTUDIO_INVOKED
  2623. 1 TEXTINCLUDE
  2624. BEGIN
  2625. "resource.h\\0"
  2626. END
  2627. 2 TEXTINCLUDE
  2628. BEGIN
  2629. "#include ""afxres.h""\\r\\n"
  2630. "\\0"
  2631. END
  2632. 3 TEXTINCLUDE
  2633. BEGIN
  2634. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2635. "\\0"
  2636. END
  2637. #endif
  2638. %s
  2639. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2640. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2641. STYLE DS_SETFONT | WS_CHILD
  2642. FONT 8, "MS Sans Serif"
  2643. BEGIN
  2644. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2645. IDC_STATIC,7,25,229,16
  2646. END
  2647. #ifdef APSTUDIO_INVOKED
  2648. GUIDELINES DESIGNINFO
  2649. BEGIN
  2650. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2651. BEGIN
  2652. LEFTMARGIN, 7
  2653. RIGHTMARGIN, 243
  2654. TOPMARGIN, 7
  2655. BOTTOMMARGIN, 55
  2656. END
  2657. END
  2658. #endif
  2659. STRINGTABLE
  2660. BEGIN
  2661. IDS_P3DACTIVEX "P3DActiveX Control"
  2662. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2663. END
  2664. STRINGTABLE
  2665. BEGIN
  2666. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2667. END
  2668. #endif
  2669. #ifndef APSTUDIO_INVOKED
  2670. 1 TYPELIB "P3DActiveX.tlb"
  2671. #endif"""
  2672. def CreatePandaVersionFiles():
  2673. version1=int(VERSION.split(".")[0])
  2674. version2=int(VERSION.split(".")[1])
  2675. version3=int(VERSION.split(".")[2])
  2676. nversion=version1*1000000+version2*1000+version3
  2677. if (DISTRIBUTOR != "cmu"):
  2678. # Subtract 1 if we are not an official version.
  2679. nversion -= 1
  2680. if (RUNTIME):
  2681. pandaversion_h = PANDAVERSION_H_RUNTIME
  2682. else:
  2683. pandaversion_h = PANDAVERSION_H
  2684. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2685. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2686. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2687. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2688. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2689. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2690. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2691. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2692. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2693. if (DISTRIBUTOR == "cmu"):
  2694. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2695. else:
  2696. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2697. if GIT_COMMIT:
  2698. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2699. # Allow creating a deterministic build by setting this.
  2700. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2701. if source_date:
  2702. # This matches the GCC / Clang format for __DATE__ __TIME__
  2703. source_date = time.gmtime(int(source_date))
  2704. try:
  2705. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2706. except ValueError:
  2707. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2708. if source_date[3:5] == ' 0':
  2709. source_date = source_date[:3] + ' ' + source_date[5:]
  2710. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2711. if not RUNTIME:
  2712. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2713. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2714. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2715. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2716. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2717. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2718. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2719. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2720. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2721. if RUNTIME:
  2722. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2723. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2724. else:
  2725. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2726. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2727. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2728. if RUNTIME:
  2729. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2730. "version" : VERSION,
  2731. "description" : "Runs 3-D games and interactive applets",
  2732. "filename" : "p3dactivex.ocx",
  2733. "mimetype" : "application/x-panda3d",
  2734. "extension" : "p3d",
  2735. "filedesc" : "Panda3D applet"}
  2736. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2737. CreatePandaVersionFiles()
  2738. ##########################################################################################
  2739. #
  2740. # Copy the "direct" tree
  2741. #
  2742. ##########################################################################################
  2743. if (PkgSkip("DIRECT")==0):
  2744. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2745. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2746. # This file used to be copied, but would nowadays cause conflicts.
  2747. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2748. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2749. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2750. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2751. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2752. # This directory doesn't exist at all any more.
  2753. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2754. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2755. # These files used to exist; remove them to avoid conflicts.
  2756. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2757. '_core.pyd', '_core.so',
  2758. 'direct.py', 'direct.pyc', 'direct.pyo',
  2759. '_direct.pyd', '_direct.so',
  2760. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2761. for basename in del_files:
  2762. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2763. if os.path.isfile(path):
  2764. print("Removing %s" % (path))
  2765. os.remove(path)
  2766. # Write an appropriate panda3d/__init__.py
  2767. p3d_init = """"Python bindings for the Panda3D libraries"
  2768. __version__ = '%s'
  2769. """ % (WHLVERSION)
  2770. if GetTarget() == 'windows':
  2771. p3d_init += """
  2772. if '__file__' in locals():
  2773. import os
  2774. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2775. if os.path.isdir(bindir):
  2776. if hasattr(os, 'add_dll_directory'):
  2777. os.add_dll_directory(bindir)
  2778. elif not os.environ.get('PATH'):
  2779. os.environ['PATH'] = bindir
  2780. else:
  2781. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2782. del os, bindir
  2783. """
  2784. if not PkgSkip("PYTHON"):
  2785. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2786. # Also add this file, for backward compatibility.
  2787. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2788. '''Alias of :mod:`panda3d.interrogatedb`.
  2789. .. deprecated:: 1.10.0
  2790. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2791. '''
  2792. if __debug__:
  2793. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2794. from .interrogatedb import *
  2795. """)
  2796. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2797. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2798. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2799. os.remove(fn)
  2800. panda_modules = ['core']
  2801. if not PkgSkip("PANDAPHYSICS"):
  2802. panda_modules.append('physics')
  2803. if not PkgSkip('PANDAFX'):
  2804. panda_modules.append('fx')
  2805. if not PkgSkip("DIRECT"):
  2806. panda_modules.append('direct')
  2807. if not PkgSkip("VISION"):
  2808. panda_modules.append('vision')
  2809. if not PkgSkip("SKEL"):
  2810. panda_modules.append('skel')
  2811. if not PkgSkip("EGG"):
  2812. panda_modules.append('egg')
  2813. if not PkgSkip("ODE"):
  2814. panda_modules.append('ode')
  2815. if not PkgSkip("VRPN"):
  2816. panda_modules.append('vrpn')
  2817. panda_modules_code = """
  2818. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2819. if __debug__:
  2820. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2821. """
  2822. for module in panda_modules:
  2823. panda_modules_code += """
  2824. try:
  2825. from panda3d.%s import *
  2826. except ImportError as err:
  2827. if "No module named %s" not in str(err):
  2828. raise""" % (module, module)
  2829. panda_modules_code += """
  2830. from direct.showbase import DConfig
  2831. def get_config_showbase():
  2832. return DConfig
  2833. def get_config_express():
  2834. return DConfig
  2835. getConfigShowbase = get_config_showbase
  2836. getConfigExpress = get_config_express
  2837. """
  2838. exthelpers_code = """
  2839. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2840. from direct.extensions_native.extension_native_helpers import *
  2841. """
  2842. if not PkgSkip("PYTHON"):
  2843. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2844. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2845. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2846. ##########################################################################################
  2847. #
  2848. # Write the dist-info directory.
  2849. #
  2850. ##########################################################################################
  2851. # This is just some basic stuff since setuptools just needs this file to
  2852. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2853. # eventually want to merge this with the metadata generator in makewheel.py.
  2854. METADATA = """Metadata-Version: 2.0
  2855. Name: Panda3D
  2856. Version: {version}
  2857. License: BSD
  2858. Home-page: https://www.panda3d.org/
  2859. Author: Panda3D Team
  2860. Author-email: [email protected]
  2861. """
  2862. ENTRY_POINTS = """[distutils.commands]
  2863. build_apps = direct.dist.commands:build_apps
  2864. bdist_apps = direct.dist.commands:bdist_apps
  2865. [setuptools.finalize_distribution_options]
  2866. build_apps = direct.dist.commands:finalize_distribution_options
  2867. """
  2868. if not PkgSkip("DIRECT"):
  2869. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2870. MakeDirectory(dist_dir)
  2871. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2872. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2873. ##########################################################################################
  2874. #
  2875. # Generate the PRC files into the ETC directory.
  2876. #
  2877. ##########################################################################################
  2878. confautoprc = ReadFile("makepanda/confauto.in")
  2879. if (PkgSkip("SPEEDTREE")==0):
  2880. # If SpeedTree is available, enable it in the config file
  2881. confautoprc = confautoprc.replace('#st#', '')
  2882. else:
  2883. # otherwise, disable it.
  2884. confautoprc = confautoprc.replace('#st#', '#')
  2885. confautoprc = confautoprc.replace('\r\n', '\n')
  2886. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2887. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2888. if PkgSkip("EGG") or GetLinkAllStatic():
  2889. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2890. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2891. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2892. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2893. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2894. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2895. if (os.path.isfile("makepanda/myconfig.in")):
  2896. configprc = ReadFile("makepanda/myconfig.in")
  2897. else:
  2898. configprc = ReadFile("makepanda/config.in")
  2899. configprc = configprc.replace('\r\n', '\n')
  2900. if (GetTarget() == 'windows'):
  2901. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2902. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2903. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2904. else:
  2905. configprc = configprc.replace("aux-display pandadx9", "")
  2906. if (GetTarget() == 'darwin'):
  2907. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2908. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2909. if not PkgSkip("FMODEX"):
  2910. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2911. if PkgSkip("GL") or GetLinkAllStatic():
  2912. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2913. if PkgSkip("GLES") or GetLinkAllStatic():
  2914. configprc = configprc.replace("\n#load-display pandagles", "")
  2915. if PkgSkip("DX9") or GetLinkAllStatic():
  2916. configprc = configprc.replace("\n#load-display pandadx9", "")
  2917. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2918. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2919. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2920. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2921. if GetTarget() == 'windows':
  2922. # Convert to Windows newlines.
  2923. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2924. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2925. else:
  2926. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2927. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2928. ##########################################################################################
  2929. #
  2930. # Copy the precompiled binaries and DLLs into the build.
  2931. #
  2932. ##########################################################################################
  2933. tp_dir = GetThirdpartyDir()
  2934. if tp_dir is not None:
  2935. dylibs = {}
  2936. if GetTarget() == 'darwin':
  2937. # Make a list of all the dylibs we ship, to figure out whether we should use
  2938. # install_name_tool to correct the library reference to point to our copy.
  2939. for pkg in PkgListGet():
  2940. if PkgSkip(pkg):
  2941. continue
  2942. tp_libdir = GetThirdpartyLibDir(pkg)
  2943. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2944. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2945. if not PkgSkip("PYTHON"):
  2946. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2947. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2948. for pkg in PkgListGet():
  2949. if PkgSkip(pkg):
  2950. continue
  2951. tp_pkg = tp_dir + pkg.lower()
  2952. if GetTarget() == 'windows':
  2953. if os.path.exists(tp_pkg + "/bin"):
  2954. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2955. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2956. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2957. elif GetTarget() == 'darwin':
  2958. tp_libdir = GetThirdpartyLibDir(pkg)
  2959. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2960. if not PkgSkip("PYTHON"):
  2961. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2962. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2963. if pkg != 'PYTHON':
  2964. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2965. for tp_lib in tp_libs:
  2966. basename = os.path.basename(tp_lib)
  2967. if basename.endswith('.dylib'):
  2968. # It's a dynamic link library. Put it in the lib directory.
  2969. target = GetOutputDir() + "/lib/" + basename
  2970. dep_prefix = "@loader_path/../lib/"
  2971. lib_id = dep_prefix + basename
  2972. else:
  2973. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2974. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2975. target = GetOutputDir() + "/" + basename
  2976. dep_prefix = "@loader_path/lib/"
  2977. lib_id = basename
  2978. if not NeedsBuild([target], [tp_lib]):
  2979. continue
  2980. CopyFile(target, tp_lib)
  2981. if os.path.islink(target) or target.endswith('.py'):
  2982. continue
  2983. # Correct the inter-library dependencies so that the build is relocatable.
  2984. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2985. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2986. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2987. line = line.strip()
  2988. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2989. continue
  2990. libdep = line.split(" ", 1)[0]
  2991. dep_basename = os.path.basename(libdep)
  2992. if dep_basename in dylibs:
  2993. dep_target = dylibs[dep_basename]
  2994. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2995. JustBuilt([target], [tp_lib])
  2996. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2997. MakeDirectory(GetOutputDir() + "/Frameworks")
  2998. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2999. else: # Linux / FreeBSD case.
  3000. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  3001. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  3002. if not PkgSkip("PYTHON"):
  3003. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  3004. base = os.path.basename(tp_lib)
  3005. if base.startswith('lib'):
  3006. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  3007. else:
  3008. # It's a Python module, like _rocketcore.so.
  3009. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  3010. if GetTarget() == 'windows':
  3011. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  3012. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  3013. if not PkgSkip("PYTHON") and not RTDIST:
  3014. # We need to copy the Python DLL to the bin directory for now.
  3015. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  3016. if GetOptimize() <= 2:
  3017. pydll += "_d.dll"
  3018. else:
  3019. pydll += ".dll"
  3020. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  3021. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  3022. CopyFile(GetOutputDir() + "/bin/", fn)
  3023. # Copy the whole Python directory.
  3024. if COPY_PYTHON:
  3025. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  3026. # NB: Python does not always ship with the correct manifest/dll.
  3027. # Figure out the correct one to ship, and grab it from WinSxS dir.
  3028. manifest = GetOutputDir() + '/tmp/python.manifest'
  3029. if os.path.isfile(manifest):
  3030. os.unlink(manifest)
  3031. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  3032. if COPY_PYTHON and os.path.isfile(manifest):
  3033. import xml.etree.ElementTree as ET
  3034. tree = ET.parse(manifest)
  3035. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  3036. else:
  3037. idents = ()
  3038. for ident in idents:
  3039. sxs_name = '_'.join([
  3040. ident.get('processorArchitecture'),
  3041. ident.get('name').lower(),
  3042. ident.get('publicKeyToken'),
  3043. ident.get('version'),
  3044. ])
  3045. # Find the manifest matching these parameters.
  3046. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  3047. manifests = glob.glob(pattern)
  3048. if not manifests:
  3049. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  3050. continue
  3051. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  3052. # Also copy the corresponding msvcr dll.
  3053. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  3054. for file in glob.glob(pattern):
  3055. CopyFile(GetOutputDir() + "/python/", file)
  3056. # Copy python.exe to ppython.exe.
  3057. if COPY_PYTHON:
  3058. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3059. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3060. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3061. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3062. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3063. # Copy over the MSVC runtime.
  3064. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3065. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3066. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3067. if ("VCTOOLSVERSION" in SDK):
  3068. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3069. else:
  3070. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3071. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3072. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3073. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3074. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3075. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3076. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3077. ########################################################################
  3078. ##
  3079. ## Copy various stuff into the build.
  3080. ##
  3081. ########################################################################
  3082. if GetTarget() == 'windows':
  3083. # Convert to Windows newlines so they can be opened by notepad.
  3084. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3085. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3086. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3087. else:
  3088. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3089. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3090. if (PkgSkip("PANDATOOL")==0):
  3091. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3092. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3093. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3094. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3095. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3096. # Since Eigen is included by all sorts of core headers, as a convenience
  3097. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3098. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3099. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3100. ########################################################################
  3101. #
  3102. # Copy header files to the built/include/parser-inc directory.
  3103. #
  3104. ########################################################################
  3105. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3106. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3107. ########################################################################
  3108. #
  3109. # Transfer all header files to the built/include directory.
  3110. #
  3111. ########################################################################
  3112. CopyAllHeaders('dtool/src/dtoolbase')
  3113. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3114. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3115. CopyAllHeaders('dtool/metalibs/dtool')
  3116. CopyAllHeaders('dtool/src/cppparser')
  3117. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3118. CopyAllHeaders('dtool/src/dconfig')
  3119. CopyAllHeaders('dtool/src/interrogatedb')
  3120. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3121. CopyAllHeaders('dtool/src/pystub')
  3122. CopyAllHeaders('dtool/src/interrogate')
  3123. CopyAllHeaders('dtool/src/test_interrogate')
  3124. CopyAllHeaders('panda/src/putil')
  3125. CopyAllHeaders('panda/src/pandabase')
  3126. CopyAllHeaders('panda/src/express')
  3127. CopyAllHeaders('panda/src/downloader')
  3128. CopyAllHeaders('panda/metalibs/pandaexpress')
  3129. CopyAllHeaders('panda/src/pipeline')
  3130. CopyAllHeaders('panda/src/linmath')
  3131. CopyAllHeaders('panda/src/putil')
  3132. CopyAllHeaders('dtool/src/prckeys')
  3133. CopyAllHeaders('panda/src/audio')
  3134. CopyAllHeaders('panda/src/event')
  3135. CopyAllHeaders('panda/src/mathutil')
  3136. CopyAllHeaders('panda/src/gsgbase')
  3137. CopyAllHeaders('panda/src/pnmimage')
  3138. CopyAllHeaders('panda/src/nativenet')
  3139. CopyAllHeaders('panda/src/net')
  3140. CopyAllHeaders('panda/src/pstatclient')
  3141. CopyAllHeaders('panda/src/gobj')
  3142. CopyAllHeaders('panda/src/movies')
  3143. CopyAllHeaders('panda/src/pgraphnodes')
  3144. CopyAllHeaders('panda/src/pgraph')
  3145. CopyAllHeaders('panda/src/cull')
  3146. CopyAllHeaders('panda/src/display')
  3147. CopyAllHeaders('panda/src/chan')
  3148. CopyAllHeaders('panda/src/char')
  3149. CopyAllHeaders('panda/src/dgraph')
  3150. CopyAllHeaders('panda/src/device')
  3151. CopyAllHeaders('panda/src/pnmtext')
  3152. CopyAllHeaders('panda/src/text')
  3153. CopyAllHeaders('panda/src/grutil')
  3154. if (PkgSkip("VISION")==0):
  3155. CopyAllHeaders('panda/src/vision')
  3156. if (PkgSkip("FFMPEG")==0):
  3157. CopyAllHeaders('panda/src/ffmpeg')
  3158. CopyAllHeaders('panda/src/tform')
  3159. CopyAllHeaders('panda/src/collide')
  3160. CopyAllHeaders('panda/src/parametrics')
  3161. CopyAllHeaders('panda/src/pgui')
  3162. CopyAllHeaders('panda/src/pnmimagetypes')
  3163. CopyAllHeaders('panda/src/recorder')
  3164. if (PkgSkip("ROCKET")==0):
  3165. CopyAllHeaders('panda/src/rocket')
  3166. if (PkgSkip("VRPN")==0):
  3167. CopyAllHeaders('panda/src/vrpn')
  3168. CopyAllHeaders('panda/src/wgldisplay')
  3169. CopyAllHeaders('panda/src/ode')
  3170. CopyAllHeaders('panda/metalibs/pandaode')
  3171. if (PkgSkip("PANDAPHYSICS")==0):
  3172. CopyAllHeaders('panda/src/physics')
  3173. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3174. CopyAllHeaders('panda/src/particlesystem')
  3175. CopyAllHeaders('panda/src/dxml')
  3176. CopyAllHeaders('panda/metalibs/panda')
  3177. CopyAllHeaders('panda/src/audiotraits')
  3178. CopyAllHeaders('panda/src/audiotraits')
  3179. CopyAllHeaders('panda/src/distort')
  3180. CopyAllHeaders('panda/src/downloadertools')
  3181. CopyAllHeaders('panda/src/windisplay')
  3182. CopyAllHeaders('panda/src/dxgsg9')
  3183. CopyAllHeaders('panda/metalibs/pandadx9')
  3184. if not PkgSkip("EGG"):
  3185. CopyAllHeaders('panda/src/egg')
  3186. CopyAllHeaders('panda/src/egg2pg')
  3187. CopyAllHeaders('panda/src/framework')
  3188. CopyAllHeaders('panda/metalibs/pandafx')
  3189. CopyAllHeaders('panda/src/glstuff')
  3190. CopyAllHeaders('panda/src/glgsg')
  3191. CopyAllHeaders('panda/src/glesgsg')
  3192. CopyAllHeaders('panda/src/gles2gsg')
  3193. if not PkgSkip("EGG"):
  3194. CopyAllHeaders('panda/metalibs/pandaegg')
  3195. if GetTarget() == 'windows':
  3196. CopyAllHeaders('panda/src/wgldisplay')
  3197. elif GetTarget() == 'darwin':
  3198. CopyAllHeaders('panda/src/osxdisplay')
  3199. CopyAllHeaders('panda/src/cocoadisplay')
  3200. elif GetTarget() == 'android':
  3201. CopyAllHeaders('panda/src/android')
  3202. CopyAllHeaders('panda/src/androiddisplay')
  3203. if not PkgSkip('X11'):
  3204. CopyAllHeaders('panda/src/x11display')
  3205. if not PkgSkip('GL'):
  3206. CopyAllHeaders('panda/src/glxdisplay')
  3207. CopyAllHeaders('panda/src/egldisplay')
  3208. CopyAllHeaders('panda/metalibs/pandagl')
  3209. CopyAllHeaders('panda/metalibs/pandagles')
  3210. CopyAllHeaders('panda/metalibs/pandagles2')
  3211. CopyAllHeaders('panda/metalibs/pandaphysics')
  3212. CopyAllHeaders('panda/src/testbed')
  3213. if (PkgSkip("PHYSX")==0):
  3214. CopyAllHeaders('panda/src/physx')
  3215. CopyAllHeaders('panda/metalibs/pandaphysx')
  3216. if (PkgSkip("BULLET")==0):
  3217. CopyAllHeaders('panda/src/bullet')
  3218. CopyAllHeaders('panda/metalibs/pandabullet')
  3219. if (PkgSkip("SPEEDTREE")==0):
  3220. CopyAllHeaders('panda/src/speedtree')
  3221. if (PkgSkip("DIRECT")==0):
  3222. CopyAllHeaders('direct/src/directbase')
  3223. CopyAllHeaders('direct/src/dcparser')
  3224. CopyAllHeaders('direct/src/deadrec')
  3225. CopyAllHeaders('direct/src/distributed')
  3226. CopyAllHeaders('direct/src/interval')
  3227. CopyAllHeaders('direct/src/showbase')
  3228. CopyAllHeaders('direct/src/motiontrail')
  3229. CopyAllHeaders('direct/src/dcparse')
  3230. if (RUNTIME or RTDIST):
  3231. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3232. if (RUNTIME):
  3233. CopyAllHeaders('direct/src/plugin_npapi')
  3234. CopyAllHeaders('direct/src/plugin_standalone')
  3235. if (PkgSkip("PANDATOOL")==0):
  3236. CopyAllHeaders('pandatool/src/pandatoolbase')
  3237. CopyAllHeaders('pandatool/src/converter')
  3238. CopyAllHeaders('pandatool/src/progbase')
  3239. CopyAllHeaders('pandatool/src/eggbase')
  3240. CopyAllHeaders('pandatool/src/bam')
  3241. CopyAllHeaders('pandatool/src/cvscopy')
  3242. CopyAllHeaders('pandatool/src/daeegg')
  3243. CopyAllHeaders('pandatool/src/daeprogs')
  3244. CopyAllHeaders('pandatool/src/dxf')
  3245. CopyAllHeaders('pandatool/src/dxfegg')
  3246. CopyAllHeaders('pandatool/src/dxfprogs')
  3247. CopyAllHeaders('pandatool/src/palettizer')
  3248. CopyAllHeaders('pandatool/src/egg-mkfont')
  3249. CopyAllHeaders('pandatool/src/eggcharbase')
  3250. CopyAllHeaders('pandatool/src/egg-optchar')
  3251. CopyAllHeaders('pandatool/src/egg-palettize')
  3252. CopyAllHeaders('pandatool/src/egg-qtess')
  3253. CopyAllHeaders('pandatool/src/eggprogs')
  3254. CopyAllHeaders('pandatool/src/flt')
  3255. CopyAllHeaders('pandatool/src/fltegg')
  3256. CopyAllHeaders('pandatool/src/fltprogs')
  3257. CopyAllHeaders('pandatool/src/imagebase')
  3258. CopyAllHeaders('pandatool/src/imageprogs')
  3259. CopyAllHeaders('pandatool/src/pfmprogs')
  3260. CopyAllHeaders('pandatool/src/lwo')
  3261. CopyAllHeaders('pandatool/src/lwoegg')
  3262. CopyAllHeaders('pandatool/src/lwoprogs')
  3263. CopyAllHeaders('pandatool/src/maya')
  3264. CopyAllHeaders('pandatool/src/mayaegg')
  3265. CopyAllHeaders('pandatool/src/maxegg')
  3266. CopyAllHeaders('pandatool/src/maxprogs')
  3267. CopyAllHeaders('pandatool/src/objegg')
  3268. CopyAllHeaders('pandatool/src/objprogs')
  3269. CopyAllHeaders('pandatool/src/vrml')
  3270. CopyAllHeaders('pandatool/src/vrmlegg')
  3271. CopyAllHeaders('pandatool/src/xfile')
  3272. CopyAllHeaders('pandatool/src/xfileegg')
  3273. CopyAllHeaders('pandatool/src/ptloader')
  3274. CopyAllHeaders('pandatool/src/miscprogs')
  3275. CopyAllHeaders('pandatool/src/pstatserver')
  3276. CopyAllHeaders('pandatool/src/text-stats')
  3277. CopyAllHeaders('pandatool/src/vrmlprogs')
  3278. CopyAllHeaders('pandatool/src/win-stats')
  3279. CopyAllHeaders('pandatool/src/xfileprogs')
  3280. if (PkgSkip("CONTRIB")==0):
  3281. CopyAllHeaders('contrib/src/contribbase')
  3282. CopyAllHeaders('contrib/src/ai')
  3283. ########################################################################
  3284. #
  3285. # These definitions are syntactic shorthand. They make it easy
  3286. # to link with the usual libraries without listing them all.
  3287. #
  3288. ########################################################################
  3289. COMMON_DTOOL_LIBS=[
  3290. 'libp3dtool.dll',
  3291. 'libp3dtoolconfig.dll',
  3292. ]
  3293. COMMON_PANDA_LIBS=[
  3294. 'libpanda.dll',
  3295. 'libpandaexpress.dll'
  3296. ] + COMMON_DTOOL_LIBS
  3297. COMMON_EGG2X_LIBS=[
  3298. 'libp3eggbase.lib',
  3299. 'libp3progbase.lib',
  3300. 'libp3converter.lib',
  3301. 'libp3pandatoolbase.lib',
  3302. 'libpandaegg.dll',
  3303. ] + COMMON_PANDA_LIBS
  3304. ########################################################################
  3305. #
  3306. # This section contains a list of all the files that need to be compiled.
  3307. #
  3308. ########################################################################
  3309. print("Generating dependencies...")
  3310. sys.stdout.flush()
  3311. #
  3312. # Compile Panda icon resource file.
  3313. # We do it first because we need it at
  3314. # the time we compile an executable.
  3315. #
  3316. if GetTarget() == 'windows':
  3317. OPTS=['DIR:panda/src/configfiles']
  3318. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3319. #
  3320. # DIRECTORY: dtool/src/dtoolbase/
  3321. #
  3322. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL', 'MIMALLOC']
  3323. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3324. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3325. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3326. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3327. #
  3328. # DIRECTORY: dtool/src/dtoolutil/
  3329. #
  3330. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3331. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3332. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3333. if GetTarget() == 'darwin':
  3334. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3335. #
  3336. # DIRECTORY: dtool/metalibs/dtool/
  3337. #
  3338. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3339. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3340. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3341. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3342. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3343. if GetTarget() == 'darwin':
  3344. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3345. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3346. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3347. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3348. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3349. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL','MIMALLOC'])
  3350. #
  3351. # DIRECTORY: dtool/src/cppparser/
  3352. #
  3353. if (not RUNTIME):
  3354. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3355. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3356. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3357. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3358. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3359. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3360. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3361. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3362. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3363. #
  3364. # DIRECTORY: dtool/src/prc/
  3365. #
  3366. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3367. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3368. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3369. #
  3370. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3371. #
  3372. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3373. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3374. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3375. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3376. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3377. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3378. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3379. #
  3380. # DIRECTORY: dtool/src/interrogatedb/
  3381. #
  3382. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3383. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3384. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3385. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3386. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3387. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3388. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3389. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3390. # stuff, so it has been renamed appropriately.
  3391. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3392. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3393. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3394. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3395. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3396. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3397. #
  3398. # DIRECTORY: dtool/src/pystub/
  3399. #
  3400. if not RUNTIME and not RTDIST:
  3401. OPTS=['DIR:dtool/src/pystub']
  3402. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3403. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3404. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3405. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3406. #
  3407. # DIRECTORY: dtool/src/interrogate/
  3408. #
  3409. if (not RUNTIME):
  3410. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3411. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3412. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3413. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3414. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3415. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3416. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3417. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3418. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3419. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3420. 'dtool/src/interrogatedb/py_panda.cxx',
  3421. 'dtool/src/interrogatedb/py_compat.cxx',
  3422. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3423. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3424. ])
  3425. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3426. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3427. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3428. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3429. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3430. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3431. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3432. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3433. if (not RTDIST):
  3434. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3435. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3436. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3437. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3438. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3439. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3440. #
  3441. # DIRECTORY: dtool/src/prckeys/
  3442. #
  3443. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3444. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3445. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3446. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3447. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3448. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3449. #
  3450. # DIRECTORY: dtool/src/test_interrogate/
  3451. #
  3452. if (not RTDIST and not RUNTIME):
  3453. OPTS=['DIR:dtool/src/test_interrogate']
  3454. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3455. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3456. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3457. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3458. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3459. #
  3460. # DIRECTORY: dtool/src/dtoolbase/
  3461. #
  3462. OPTS=['DIR:dtool/src/dtoolbase']
  3463. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3464. IGATEFILES += [
  3465. "typeHandle.h",
  3466. "typeHandle_ext.h",
  3467. "typeRegistry.h",
  3468. "typedObject.h",
  3469. "neverFreeMemory.h",
  3470. ]
  3471. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3472. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3473. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3474. #
  3475. # DIRECTORY: dtool/src/dtoolutil/
  3476. #
  3477. OPTS=['DIR:dtool/src/dtoolutil']
  3478. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3479. IGATEFILES += [
  3480. "config_dtoolutil.h",
  3481. "pandaSystem.h",
  3482. "dSearchPath.h",
  3483. "executionEnvironment.h",
  3484. "textEncoder.h",
  3485. "textEncoder_ext.h",
  3486. "filename.h",
  3487. "filename_ext.h",
  3488. "globPattern.h",
  3489. "globPattern_ext.h",
  3490. "pandaFileStream.h",
  3491. "lineStream.h",
  3492. ]
  3493. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3494. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3495. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3496. #
  3497. # DIRECTORY: dtool/src/prc/
  3498. #
  3499. OPTS=['DIR:dtool/src/prc']
  3500. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3501. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3502. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3503. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3504. #
  3505. # DIRECTORY: panda/src/pandabase/
  3506. #
  3507. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3508. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3509. #
  3510. # DIRECTORY: panda/src/express/
  3511. #
  3512. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3513. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3514. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3515. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3516. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3517. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3518. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3519. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3520. #
  3521. # DIRECTORY: panda/src/downloader/
  3522. #
  3523. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3524. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3525. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3526. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3527. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3528. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3529. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3530. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3531. #
  3532. # DIRECTORY: panda/metalibs/pandaexpress/
  3533. #
  3534. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3535. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3536. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3537. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3538. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3539. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3540. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3541. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3542. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3543. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3544. #
  3545. # DIRECTORY: panda/src/pipeline/
  3546. #
  3547. if (not RUNTIME):
  3548. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3549. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3550. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3551. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3552. OPTS=['DIR:panda/src/pipeline']
  3553. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3554. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3555. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3556. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3557. #
  3558. # DIRECTORY: panda/src/linmath/
  3559. #
  3560. if (not RUNTIME):
  3561. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3562. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3563. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3564. OPTS=['DIR:panda/src/linmath']
  3565. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3566. for ifile in IGATEFILES[:]:
  3567. if "_src." in ifile:
  3568. IGATEFILES.remove(ifile)
  3569. IGATEFILES.remove('cast_to_double.h')
  3570. IGATEFILES.remove('lmat_ops.h')
  3571. IGATEFILES.remove('cast_to_float.h')
  3572. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3573. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3574. #
  3575. # DIRECTORY: panda/src/putil/
  3576. #
  3577. if (not RUNTIME):
  3578. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3579. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3580. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3581. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3582. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3583. IGATEFILES.remove("test_bam.h")
  3584. IGATEFILES.remove("config_util.h")
  3585. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3586. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3587. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3588. #
  3589. # DIRECTORY: panda/src/audio/
  3590. #
  3591. if (not RUNTIME):
  3592. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3593. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3594. OPTS=['DIR:panda/src/audio']
  3595. IGATEFILES=["audio.h"]
  3596. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3597. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3598. #
  3599. # DIRECTORY: panda/src/event/
  3600. #
  3601. if (not RUNTIME):
  3602. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3603. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3604. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3605. OPTS=['DIR:panda/src/event']
  3606. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3607. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3608. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3609. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3610. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3611. #
  3612. # DIRECTORY: panda/src/mathutil/
  3613. #
  3614. if (not RUNTIME):
  3615. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3616. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3617. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3618. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3619. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3620. for ifile in IGATEFILES[:]:
  3621. if "_src." in ifile:
  3622. IGATEFILES.remove(ifile)
  3623. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3624. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3625. #
  3626. # DIRECTORY: panda/src/gsgbase/
  3627. #
  3628. if (not RUNTIME):
  3629. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3630. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3631. OPTS=['DIR:panda/src/gsgbase']
  3632. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3633. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3634. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3635. #
  3636. # DIRECTORY: panda/src/pnmimage/
  3637. #
  3638. if (not RUNTIME):
  3639. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3640. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3641. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3642. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3643. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3644. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3645. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3646. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3647. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3648. #
  3649. # DIRECTORY: panda/src/nativenet/
  3650. #
  3651. if (not RUNTIME):
  3652. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3653. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3654. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3655. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3656. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3657. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3658. #
  3659. # DIRECTORY: panda/src/net/
  3660. #
  3661. if (not RUNTIME):
  3662. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3663. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3664. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3665. OPTS=['DIR:panda/src/net']
  3666. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3667. IGATEFILES.remove("datagram_ui.h")
  3668. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3669. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3670. #
  3671. # DIRECTORY: panda/src/pstatclient/
  3672. #
  3673. if (not RUNTIME):
  3674. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3675. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3676. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3677. OPTS=['DIR:panda/src/pstatclient']
  3678. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3679. IGATEFILES.remove("config_pstats.h")
  3680. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3681. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3682. PyTargetAdd('p3pstatclient_pStatClient_ext.obj', opts=OPTS, input='pStatClient_ext.cxx')
  3683. #
  3684. # DIRECTORY: panda/src/gobj/
  3685. #
  3686. if (not RUNTIME):
  3687. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3688. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3689. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3690. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3691. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3692. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3693. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3694. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3695. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3696. #
  3697. # DIRECTORY: panda/src/pgraphnodes/
  3698. #
  3699. if (not RUNTIME):
  3700. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3701. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3702. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3703. OPTS=['DIR:panda/src/pgraphnodes']
  3704. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3705. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3706. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3707. #
  3708. # DIRECTORY: panda/src/pgraph/
  3709. #
  3710. if (not RUNTIME):
  3711. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3712. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3713. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3714. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3715. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3716. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3717. OPTS=['DIR:panda/src/pgraph']
  3718. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3719. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3720. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3721. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3722. #
  3723. # DIRECTORY: panda/src/cull/
  3724. #
  3725. if (not RUNTIME):
  3726. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3727. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3728. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3729. OPTS=['DIR:panda/src/cull']
  3730. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3731. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3732. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3733. #
  3734. # DIRECTORY: panda/src/dgraph/
  3735. #
  3736. if (not RUNTIME):
  3737. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3738. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3739. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3740. OPTS=['DIR:panda/src/dgraph']
  3741. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3742. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3743. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3744. #
  3745. # DIRECTORY: panda/src/device/
  3746. #
  3747. if (not RUNTIME):
  3748. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3749. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3750. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3751. OPTS=['DIR:panda/src/device']
  3752. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3753. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3754. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3755. #
  3756. # DIRECTORY: panda/src/display/
  3757. #
  3758. if (not RUNTIME):
  3759. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3760. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3761. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3762. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3763. OPTS=['DIR:panda/src/display', 'X11']
  3764. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3765. IGATEFILES.remove("renderBuffer.h")
  3766. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3767. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3768. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3769. if RTDIST and GetTarget() == 'darwin':
  3770. OPTS=['DIR:panda/src/display']
  3771. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3772. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3773. #
  3774. # DIRECTORY: panda/src/chan/
  3775. #
  3776. if (not RUNTIME):
  3777. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3778. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3779. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3780. OPTS=['DIR:panda/src/chan']
  3781. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3782. IGATEFILES.remove('movingPart.h')
  3783. IGATEFILES.remove('animChannelFixed.h')
  3784. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3785. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3786. # DIRECTORY: panda/src/char/
  3787. #
  3788. if (not RUNTIME):
  3789. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3790. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3791. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3792. OPTS=['DIR:panda/src/char']
  3793. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3794. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3795. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3796. #
  3797. # DIRECTORY: panda/src/pnmtext/
  3798. #
  3799. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3800. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3801. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3802. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3803. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3804. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3805. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3806. #
  3807. # DIRECTORY: panda/src/text/
  3808. #
  3809. if (not RUNTIME):
  3810. if not PkgSkip("HARFBUZZ"):
  3811. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3812. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3813. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3814. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3815. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3816. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3817. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3818. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3819. #
  3820. # DIRECTORY: panda/src/movies/
  3821. #
  3822. if (not RUNTIME):
  3823. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3824. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3825. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3826. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3827. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3828. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3829. #
  3830. # DIRECTORY: panda/src/grutil/
  3831. #
  3832. if (not RUNTIME):
  3833. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3834. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3835. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3836. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3837. OPTS=['DIR:panda/src/grutil']
  3838. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3839. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3840. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3841. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3842. #
  3843. # DIRECTORY: panda/src/tform/
  3844. #
  3845. if (not RUNTIME):
  3846. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3847. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3848. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3849. OPTS=['DIR:panda/src/tform']
  3850. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3851. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3852. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3853. #
  3854. # DIRECTORY: panda/src/collide/
  3855. #
  3856. if (not RUNTIME):
  3857. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3858. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3859. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3860. OPTS=['DIR:panda/src/collide']
  3861. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3862. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3863. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3864. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3865. #
  3866. # DIRECTORY: panda/src/parametrics/
  3867. #
  3868. if (not RUNTIME):
  3869. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3870. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3871. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3872. OPTS=['DIR:panda/src/parametrics']
  3873. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3874. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3875. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3876. #
  3877. # DIRECTORY: panda/src/pgui/
  3878. #
  3879. if (not RUNTIME):
  3880. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3881. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3882. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3883. OPTS=['DIR:panda/src/pgui']
  3884. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3885. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3886. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3887. #
  3888. # DIRECTORY: panda/src/pnmimagetypes/
  3889. #
  3890. if (not RUNTIME):
  3891. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3892. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3893. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3894. #
  3895. # DIRECTORY: panda/src/recorder/
  3896. #
  3897. if (not RUNTIME):
  3898. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3899. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3900. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3901. OPTS=['DIR:panda/src/recorder']
  3902. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3903. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3904. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3905. #
  3906. # DIRECTORY: panda/src/dxml/
  3907. #
  3908. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3909. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3910. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3911. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3912. if (not RUNTIME):
  3913. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3914. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3915. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3916. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3917. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3918. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3919. #
  3920. # DIRECTORY: panda/metalibs/panda/
  3921. #
  3922. if (not RUNTIME):
  3923. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3924. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3925. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3926. 'SETUPAPI', 'INOTIFY']
  3927. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3928. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3929. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3930. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3931. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3932. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3933. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3934. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3935. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3936. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3937. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3938. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3939. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3940. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3941. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3942. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3943. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3944. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3945. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3946. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3947. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3948. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3949. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3950. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3951. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3952. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3953. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3954. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3955. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3956. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3957. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3958. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3959. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3960. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3961. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3962. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3963. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3964. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3965. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3966. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3967. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3968. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3969. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3970. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3971. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3972. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3973. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3974. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3975. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3976. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3977. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3978. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3979. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3980. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3981. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3982. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3983. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3984. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3985. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3986. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3987. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3988. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3989. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3990. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3991. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3992. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3993. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3994. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3995. if PkgSkip("FREETYPE")==0:
  3996. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3997. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3998. TargetAdd('libpanda.dll', opts=OPTS)
  3999. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  4000. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  4001. PyTargetAdd('core_module.obj', input='libp3prc.in')
  4002. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  4003. PyTargetAdd('core_module.obj', input='libp3express.in')
  4004. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  4005. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  4006. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  4007. PyTargetAdd('core_module.obj', input='libp3cull.in')
  4008. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  4009. PyTargetAdd('core_module.obj', input='libp3chan.in')
  4010. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  4011. PyTargetAdd('core_module.obj', input='libp3char.in')
  4012. PyTargetAdd('core_module.obj', input='libp3collide.in')
  4013. PyTargetAdd('core_module.obj', input='libp3device.in')
  4014. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  4015. PyTargetAdd('core_module.obj', input='libp3display.in')
  4016. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  4017. PyTargetAdd('core_module.obj', input='libp3event.in')
  4018. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  4019. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  4020. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  4021. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  4022. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  4023. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  4024. PyTargetAdd('core_module.obj', input='libp3text.in')
  4025. PyTargetAdd('core_module.obj', input='libp3tform.in')
  4026. PyTargetAdd('core_module.obj', input='libp3putil.in')
  4027. PyTargetAdd('core_module.obj', input='libp3audio.in')
  4028. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  4029. PyTargetAdd('core_module.obj', input='libp3net.in')
  4030. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  4031. PyTargetAdd('core_module.obj', input='libp3movies.in')
  4032. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  4033. if PkgSkip("FREETYPE")==0:
  4034. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  4035. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  4036. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  4037. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  4038. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  4039. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  4040. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  4041. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  4042. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  4043. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  4044. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  4045. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  4046. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  4047. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  4048. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  4049. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  4050. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  4051. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  4052. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  4053. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  4054. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  4055. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  4056. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  4057. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  4058. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  4059. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  4060. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4061. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4062. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4063. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4064. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4065. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4066. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4067. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4068. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4069. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4070. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4071. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4072. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4073. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4074. if PkgSkip("FREETYPE")==0:
  4075. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4076. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4077. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4078. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4079. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4080. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4081. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4082. PyTargetAdd('core.pyd', input='p3pstatclient_pStatClient_ext.obj')
  4083. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4084. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4085. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4086. PyTargetAdd('core.pyd', input='core_module.obj')
  4087. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4088. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4089. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4090. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4091. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4092. #
  4093. # DIRECTORY: panda/src/vision/
  4094. #
  4095. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4096. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4097. if not PkgSkip("FFMPEG"):
  4098. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4099. if not PkgSkip("OPENCV"):
  4100. DefSymbol("OPENCV", "HAVE_OPENCV")
  4101. if OPENCV_VER_23:
  4102. DefSymbol("OPENCV", "OPENCV_VER_23")
  4103. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4104. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4105. 'dtool_have_ffmpeg.dat',
  4106. 'dtool_have_opencv.dat',
  4107. 'dtool_have_directcam.dat',
  4108. ])
  4109. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4110. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4111. TargetAdd('libp3vision.dll', opts=OPTS)
  4112. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4113. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4114. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4115. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4116. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4117. PyTargetAdd('vision_module.obj', opts=OPTS)
  4118. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4119. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4120. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4121. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4122. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4123. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4124. #
  4125. # DIRECTORY: panda/src/rocket/
  4126. #
  4127. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4128. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4129. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4130. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4131. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4132. TargetAdd('libp3rocket.dll', opts=OPTS)
  4133. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4134. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4135. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4136. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4137. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4138. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4139. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4140. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4141. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4142. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4143. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4144. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4145. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4146. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4147. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4148. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4149. #
  4150. # DIRECTORY: panda/src/p3skel
  4151. #
  4152. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4153. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4154. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4155. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4156. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4157. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4158. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4159. #
  4160. # DIRECTORY: panda/src/p3skel
  4161. #
  4162. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4163. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4164. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4165. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4166. TargetAdd('libpandaskel.dll', opts=OPTS)
  4167. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4168. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4169. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4170. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4171. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4172. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4173. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4174. #
  4175. # DIRECTORY: panda/src/distort/
  4176. #
  4177. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4178. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4179. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4180. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4181. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4182. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4183. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4184. #
  4185. # DIRECTORY: panda/metalibs/pandafx/
  4186. #
  4187. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4188. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4189. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4190. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4191. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4192. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4193. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4194. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4195. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4196. PyTargetAdd('fx_module.obj', opts=OPTS)
  4197. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4198. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4199. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4200. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4201. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4202. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4203. #
  4204. # DIRECTORY: panda/src/vrpn/
  4205. #
  4206. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4207. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4208. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4209. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4210. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4211. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4212. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4213. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4214. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4215. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4216. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4217. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4218. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4219. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4220. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4221. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4222. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4223. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4224. #
  4225. # DIRECTORY: panda/src/ffmpeg
  4226. #
  4227. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4228. if not PkgSkip("SWSCALE"):
  4229. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4230. if not PkgSkip("SWRESAMPLE"):
  4231. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4232. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4233. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4234. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4235. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4236. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4237. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4238. #
  4239. # DIRECTORY: panda/src/audiotraits/
  4240. #
  4241. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4242. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4243. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4244. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4245. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4246. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4247. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4248. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4249. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4250. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4251. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4252. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4253. #
  4254. # DIRECTORY: panda/src/downloadertools/
  4255. #
  4256. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4257. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4258. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4259. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4260. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4261. TargetAdd('apply_patch.exe', opts=OPTS)
  4262. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4263. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4264. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4265. TargetAdd('build_patch.exe', opts=OPTS)
  4266. if not PkgSkip("ZLIB"):
  4267. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4268. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4269. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4270. TargetAdd('check_adler.exe', opts=OPTS)
  4271. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4272. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4273. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4274. TargetAdd('check_crc.exe', opts=OPTS)
  4275. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4276. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4277. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4278. TargetAdd('check_md5.exe', opts=OPTS)
  4279. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4280. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4281. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4282. TargetAdd('pdecrypt.exe', opts=OPTS)
  4283. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4284. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4285. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4286. TargetAdd('pencrypt.exe', opts=OPTS)
  4287. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4288. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4289. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4290. TargetAdd('show_ddb.exe', opts=OPTS)
  4291. #
  4292. # DIRECTORY: panda/src/downloadertools/
  4293. #
  4294. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4295. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4296. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4297. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4298. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4299. TargetAdd('multify.exe', opts=OPTS)
  4300. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4301. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4302. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4303. TargetAdd('pzip.exe', opts=OPTS)
  4304. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4305. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4306. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4307. TargetAdd('punzip.exe', opts=OPTS)
  4308. #
  4309. # DIRECTORY: panda/src/windisplay/
  4310. #
  4311. if (GetTarget() == 'windows' and not RUNTIME):
  4312. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4313. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4314. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4315. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4316. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4317. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4318. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4319. #
  4320. # DIRECTORY: panda/metalibs/pandadx9/
  4321. #
  4322. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4323. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4324. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4325. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4326. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4327. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4328. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4329. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4330. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4331. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4332. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4333. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4334. #
  4335. # DIRECTORY: panda/src/egg/
  4336. #
  4337. if not RUNTIME and not PkgSkip("EGG"):
  4338. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4339. CreateFile(GetOutputDir()+"/include/parser.h")
  4340. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4341. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4342. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4343. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4344. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4345. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4346. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4347. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4348. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4349. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4350. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4351. #
  4352. # DIRECTORY: panda/src/egg2pg/
  4353. #
  4354. if not RUNTIME and not PkgSkip("EGG"):
  4355. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4356. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4357. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4358. OPTS=['DIR:panda/src/egg2pg']
  4359. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4360. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4361. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4362. #
  4363. # DIRECTORY: panda/src/framework/
  4364. #
  4365. if (not RUNTIME):
  4366. deps = []
  4367. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4368. if GetLinkAllStatic():
  4369. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4370. if not PkgSkip("GL"):
  4371. DefSymbol("FRAMEWORK", "HAVE_GL")
  4372. if not PkgSkip("TINYDISPLAY"):
  4373. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4374. if not PkgSkip("EGG"):
  4375. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4376. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4377. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4378. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4379. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4380. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4381. #
  4382. # DIRECTORY: panda/src/glgsg/
  4383. #
  4384. if (not RUNTIME and PkgSkip("GL")==0):
  4385. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4386. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4387. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4388. #
  4389. # DIRECTORY: panda/src/glesgsg/
  4390. #
  4391. if (not RUNTIME and PkgSkip("GLES")==0):
  4392. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4393. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4394. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4395. #
  4396. # DIRECTORY: panda/src/gles2gsg/
  4397. #
  4398. if (not RUNTIME and PkgSkip("GLES2")==0):
  4399. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4400. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4401. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4402. #
  4403. # DIRECTORY: panda/metalibs/pandaegg/
  4404. #
  4405. if not RUNTIME and not PkgSkip("EGG"):
  4406. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4407. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4408. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4409. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4410. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4411. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4412. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4413. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4414. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4415. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4416. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4417. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4418. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4419. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4420. PyTargetAdd('egg_module.obj', opts=OPTS)
  4421. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4422. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4423. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4424. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4425. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4426. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4427. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4428. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4429. #
  4430. # DIRECTORY: panda/src/x11display/
  4431. #
  4432. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4433. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4434. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4435. #
  4436. # DIRECTORY: panda/src/glxdisplay/
  4437. #
  4438. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4439. DefSymbol('GLX', 'HAVE_GLX', '')
  4440. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4441. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4442. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4443. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4444. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4445. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4446. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4447. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4448. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4449. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4450. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4451. #
  4452. # DIRECTORY: panda/src/cocoadisplay/
  4453. #
  4454. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4455. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4456. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4457. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4458. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4459. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4460. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4461. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4462. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4463. if (PkgSkip('PANDAFX')==0):
  4464. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4465. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4466. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4467. #
  4468. # DIRECTORY: panda/src/osxdisplay/
  4469. #
  4470. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4471. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4472. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4473. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4474. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4475. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4476. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4477. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4478. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4479. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4480. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4481. if (PkgSkip('PANDAFX')==0):
  4482. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4483. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4484. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4485. #
  4486. # DIRECTORY: panda/src/wgldisplay/
  4487. #
  4488. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4489. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4490. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4491. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4492. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4493. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4494. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4495. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4496. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4497. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4498. if (PkgSkip('PANDAFX')==0):
  4499. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4500. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4501. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4502. #
  4503. # DIRECTORY: panda/src/egldisplay/
  4504. #
  4505. # If we're not compiling with any windowing system at all, but we do have EGL,
  4506. # we can use that to create a headless libpandagl instead.
  4507. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4508. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4509. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4510. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4511. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4512. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4513. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4514. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4515. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4516. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4517. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4518. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4519. # As a temporary solution for #1086, build this module, which we can use as a
  4520. # fallback to OpenGL for headless systems.
  4521. DefSymbol('EGL', 'HAVE_EGL', '')
  4522. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4523. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4524. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4525. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4526. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4527. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4528. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4529. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4530. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4531. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4532. #
  4533. # DIRECTORY: panda/src/egldisplay/
  4534. #
  4535. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4536. DefSymbol('GLES', 'OPENGLES_1', '')
  4537. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4538. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4539. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4540. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4541. if not PkgSkip("X11"):
  4542. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4543. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4544. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4545. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4546. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4547. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4548. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4549. #
  4550. # DIRECTORY: panda/src/egldisplay/
  4551. #
  4552. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4553. DefSymbol('GLES2', 'OPENGLES_2', '')
  4554. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4555. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4556. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4557. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4558. if not PkgSkip("X11"):
  4559. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4560. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4561. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4562. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4563. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4564. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4565. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4566. #
  4567. # DIRECTORY: panda/src/ode/
  4568. #
  4569. if (PkgSkip("ODE")==0 and not RUNTIME):
  4570. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4571. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4572. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4573. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4574. OPTS=['DIR:panda/src/ode', 'ODE']
  4575. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4576. IGATEFILES.remove("odeConvexGeom.h")
  4577. IGATEFILES.remove("odeHelperStructs.h")
  4578. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4579. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4580. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4581. #
  4582. # DIRECTORY: panda/metalibs/pandaode/
  4583. #
  4584. if (PkgSkip("ODE")==0 and not RUNTIME):
  4585. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4586. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4587. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4588. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4589. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4590. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4591. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4592. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4593. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4594. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4595. PyTargetAdd('ode_module.obj', opts=OPTS)
  4596. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4597. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4598. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4599. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4600. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4601. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4602. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4603. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4604. #
  4605. # DIRECTORY: panda/src/bullet/
  4606. #
  4607. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4608. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4609. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4610. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4611. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4612. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4613. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4614. #
  4615. # DIRECTORY: panda/metalibs/pandabullet/
  4616. #
  4617. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4618. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4619. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4620. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4621. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4622. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4623. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4624. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4625. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4626. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4627. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4628. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4629. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4630. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4631. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4632. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4633. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4634. #
  4635. # DIRECTORY: panda/src/physx/
  4636. #
  4637. if (PkgSkip("PHYSX")==0):
  4638. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4639. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4640. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4641. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4642. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4643. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4644. #
  4645. # DIRECTORY: panda/metalibs/pandaphysx/
  4646. #
  4647. if (PkgSkip("PHYSX")==0):
  4648. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4649. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4650. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4651. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4652. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4653. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4654. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4655. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4656. PyTargetAdd('physx_module.obj', opts=OPTS)
  4657. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4658. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4659. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4660. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4661. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4662. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4663. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4664. #
  4665. # DIRECTORY: panda/src/physics/
  4666. #
  4667. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4668. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4669. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4670. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4671. OPTS=['DIR:panda/src/physics']
  4672. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4673. IGATEFILES.remove("forces.h")
  4674. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4675. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4676. #
  4677. # DIRECTORY: panda/src/particlesystem/
  4678. #
  4679. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4680. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4681. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4682. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4683. OPTS=['DIR:panda/src/particlesystem']
  4684. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4685. IGATEFILES.remove('orientedParticle.h')
  4686. IGATEFILES.remove('orientedParticleFactory.h')
  4687. IGATEFILES.remove('particlefactories.h')
  4688. IGATEFILES.remove('emitters.h')
  4689. IGATEFILES.remove('particles.h')
  4690. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4691. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4692. #
  4693. # DIRECTORY: panda/metalibs/pandaphysics/
  4694. #
  4695. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4696. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4697. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4698. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4699. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4700. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4701. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4702. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4703. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4704. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4705. OPTS=['DIR:panda/metalibs/pandaphysics']
  4706. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4707. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4708. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4709. PyTargetAdd('physics_module.obj', opts=OPTS)
  4710. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4711. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4712. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4713. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4714. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4715. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4716. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4717. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4718. #
  4719. # DIRECTORY: panda/src/speedtree/
  4720. #
  4721. if (PkgSkip("SPEEDTREE")==0):
  4722. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4723. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4724. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4725. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4726. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4727. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4728. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4729. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4730. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4731. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4732. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4733. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4734. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4735. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4736. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4737. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4738. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4739. #
  4740. # DIRECTORY: panda/src/testbed/
  4741. #
  4742. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4743. OPTS=['DIR:panda/src/testbed']
  4744. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4745. TargetAdd('pview.exe', input='pview_pview.obj')
  4746. TargetAdd('pview.exe', input='libp3framework.dll')
  4747. if not PkgSkip("EGG"):
  4748. TargetAdd('pview.exe', input='libpandaegg.dll')
  4749. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4750. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4751. if GetLinkAllStatic() and not PkgSkip("GL"):
  4752. TargetAdd('pview.exe', input='libpandagl.dll')
  4753. #
  4754. # DIRECTORY: panda/src/android/
  4755. #
  4756. if (not RUNTIME and GetTarget() == 'android'):
  4757. OPTS=['DIR:panda/src/android']
  4758. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4759. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4760. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4761. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4762. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4763. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4764. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4765. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4766. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4767. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4768. if (not RTDIST and PkgSkip("PVIEW")==0):
  4769. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4770. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4771. TargetAdd('libpview.dll', input='android_main.obj')
  4772. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4773. TargetAdd('libpview.dll', input='libp3framework.dll')
  4774. if not PkgSkip("EGG"):
  4775. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4776. TargetAdd('libpview.dll', input='libp3android.dll')
  4777. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4778. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4779. if (not RTDIST and PkgSkip("PYTHON")==0):
  4780. OPTS += ['PYTHON']
  4781. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4782. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4783. TargetAdd('libppython.dll', input='android_main.obj')
  4784. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4785. TargetAdd('libppython.dll', input='libp3framework.dll')
  4786. TargetAdd('libppython.dll', input='libp3android.dll')
  4787. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4788. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4789. #
  4790. # DIRECTORY: panda/src/androiddisplay/
  4791. #
  4792. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4793. DefSymbol('GLES', 'OPENGLES_1', '')
  4794. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4795. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4796. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4797. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4798. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4799. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4800. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4801. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4802. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4803. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4804. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4805. #
  4806. # DIRECTORY: panda/src/tinydisplay/
  4807. #
  4808. if not RUNTIME and not PkgSkip("TINYDISPLAY"):
  4809. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4810. if not PkgSkip("X11"):
  4811. OPTS += ['X11']
  4812. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4813. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4814. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4815. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4816. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4817. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4818. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4819. if GetTarget() == 'darwin':
  4820. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4821. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4822. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4823. elif GetTarget() == 'windows':
  4824. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4825. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4826. elif not PkgSkip("X11"):
  4827. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4828. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4829. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4830. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4831. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4832. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4833. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4834. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4835. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4836. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4837. #
  4838. # DIRECTORY: direct/src/directbase/
  4839. #
  4840. if (PkgSkip("DIRECT")==0):
  4841. OPTS=['DIR:direct/src/directbase']
  4842. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4843. #
  4844. # DIRECTORY: direct/src/dcparser/
  4845. #
  4846. if (PkgSkip("DIRECT")==0):
  4847. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4848. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4849. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4850. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4851. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4852. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4853. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4854. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4855. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4856. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4857. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4858. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4859. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4860. #
  4861. # DIRECTORY: direct/src/deadrec/
  4862. #
  4863. if (PkgSkip("DIRECT")==0):
  4864. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4865. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4866. OPTS=['DIR:direct/src/deadrec']
  4867. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4868. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4869. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4870. #
  4871. # DIRECTORY: direct/src/distributed/
  4872. #
  4873. if (PkgSkip("DIRECT")==0):
  4874. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4875. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4876. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4877. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4878. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4879. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4880. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4881. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4882. #
  4883. # DIRECTORY: direct/src/interval/
  4884. #
  4885. if (PkgSkip("DIRECT")==0):
  4886. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4887. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4888. OPTS=['DIR:direct/src/interval']
  4889. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4890. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4891. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4892. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4893. #
  4894. # DIRECTORY: direct/src/showbase/
  4895. #
  4896. if (PkgSkip("DIRECT")==0):
  4897. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4898. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4899. if GetTarget() == 'darwin':
  4900. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4901. OPTS=['DIR:direct/src/showbase']
  4902. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4903. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4904. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4905. #
  4906. # DIRECTORY: direct/src/motiontrail/
  4907. #
  4908. if (PkgSkip("DIRECT")==0):
  4909. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4910. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4911. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4912. OPTS=['DIR:direct/src/motiontrail']
  4913. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4914. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4915. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4916. #
  4917. # DIRECTORY: direct/metalibs/direct/
  4918. #
  4919. if (PkgSkip("DIRECT")==0):
  4920. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4921. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4922. if GetTarget() == 'darwin':
  4923. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4924. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4925. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4926. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4927. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4928. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4929. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4930. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4931. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4932. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4933. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4934. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4935. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4936. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4937. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4938. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4939. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4940. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4941. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4942. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4943. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4944. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4945. # the Python libraries. If a C++ user needs these modules, we can move them
  4946. # back and filter out the Python-specific code.
  4947. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4948. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4949. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4950. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4951. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4952. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4953. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4954. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4955. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4956. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4957. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4958. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4959. #
  4960. # DIRECTORY: direct/src/dcparse/
  4961. #
  4962. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4963. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4964. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4965. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4966. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4967. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4968. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4969. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4970. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4971. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4972. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4973. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4974. #
  4975. # DIRECTORY: direct/src/plugin/
  4976. #
  4977. if (RTDIST or RUNTIME):
  4978. # Explicitly define this as we don't include dtool_config.h here.
  4979. if GetTarget() not in ('windows', 'darwin'):
  4980. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4981. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4982. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4983. OPTS += ['ZLIB', 'MSIMG']
  4984. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4985. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4986. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4987. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4988. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4989. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4990. if GetTarget() == 'darwin':
  4991. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4992. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4993. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4994. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4995. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4996. if (RTDIST):
  4997. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4998. TargetAdd(fname, input='plugin_plugin.obj')
  4999. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  5000. TargetAdd(fname, input='plugin_wstring_encode.obj')
  5001. TargetAdd(fname, input='plugin_parse_color.obj')
  5002. TargetAdd(fname, input='plugin_find_root_dir.obj')
  5003. if GetTarget() == 'darwin':
  5004. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  5005. TargetAdd(fname, input='plugin_fileSpec.obj')
  5006. TargetAdd(fname, input='plugin_binaryXml.obj')
  5007. TargetAdd(fname, input='plugin_handleStream.obj')
  5008. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  5009. TargetAdd(fname, input='libp3tinyxml.ilb')
  5010. if GetTarget() == 'darwin':
  5011. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  5012. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  5013. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  5014. if (PkgSkip("PYTHON")==0 and RTDIST):
  5015. # Freeze VFSImporter and its dependency modules into p3dpython.
  5016. # Mark panda3d.core as a dependency to make sure to build that first.
  5017. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  5018. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  5019. OPTS += ['PYTHON']
  5020. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5021. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5022. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  5023. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  5024. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  5025. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  5026. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  5027. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  5028. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  5029. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  5030. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  5031. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  5032. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  5033. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  5034. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  5035. if GetTarget() == 'windows':
  5036. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  5037. OPTS.append("NON_CONSOLE")
  5038. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5039. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5040. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  5041. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  5042. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  5043. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  5044. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  5045. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  5046. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  5047. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  5048. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  5049. if GetTarget() == 'darwin':
  5050. OPTS += ['OPT:2']
  5051. if (PkgSkip("FLTK")==0):
  5052. OPTS.append("FLTK")
  5053. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  5054. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  5055. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5056. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5057. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5058. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  5059. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  5060. if GetTarget() == 'darwin':
  5061. OPTS += ['OPT:2']
  5062. TargetAdd('p3dcert.exe', opts=OPTS)
  5063. elif (PkgSkip("WX")==0):
  5064. OPTS += ["WX", "RTTI"]
  5065. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5066. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5067. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5068. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5069. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5070. if GetTarget() == "darwin":
  5071. OPTS += ['GL', 'OPT:2']
  5072. TargetAdd('p3dcert.exe', opts=OPTS)
  5073. #
  5074. # DIRECTORY: direct/src/plugin_npapi/
  5075. #
  5076. if RUNTIME:
  5077. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5078. if GetTarget() == 'windows':
  5079. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5080. "version" : VERSION,
  5081. "description" : "Runs 3-D games and interactive applets",
  5082. "filename" : "nppanda3d.dll",
  5083. "mimetype" : "application/x-panda3d",
  5084. "extension" : "p3d",
  5085. "filedesc" : "Panda3D applet"}
  5086. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5087. elif GetTarget() == 'darwin':
  5088. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5089. OPTS += ['GTK2']
  5090. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5091. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5092. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5093. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5094. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5095. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5096. if GetTarget() == 'windows':
  5097. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5098. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5099. elif GetTarget() == 'darwin':
  5100. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5101. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5102. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5103. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5104. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5105. #
  5106. # DIRECTORY: direct/src/plugin_activex/
  5107. #
  5108. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5109. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5110. DefSymbol('ACTIVEX', '_USRDLL', '')
  5111. DefSymbol('ACTIVEX', '_WINDLL', '')
  5112. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5113. DefSymbol('ACTIVEX', '_MBCS', '')
  5114. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5115. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5116. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5117. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5118. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5119. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5120. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5121. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5122. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5123. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5124. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5125. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5126. #
  5127. # DIRECTORY: direct/src/plugin_standalone/
  5128. #
  5129. if (RUNTIME):
  5130. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5131. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5132. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5133. if GetTarget() == 'windows':
  5134. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5135. "version" : VERSION,
  5136. "description" : "Runs 3-D games and interactive applets",
  5137. "filename" : "panda3d.exe",
  5138. "mimetype" : "application/x-panda3d",
  5139. "extension" : "p3d",
  5140. "filedesc" : "Panda3D applet",
  5141. "icon" : "panda3d.ico"}
  5142. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5143. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5144. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5145. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5146. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5147. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5148. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5149. if GetTarget() == 'darwin':
  5150. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5151. elif GetTarget() == 'windows':
  5152. TargetAdd('panda3d.exe', input='panda3d.res')
  5153. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5154. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5155. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5156. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5157. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5158. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5159. if (GetTarget() == 'darwin'):
  5160. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5161. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5162. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5163. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5164. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5165. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5166. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5167. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5168. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5169. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5170. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5171. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5172. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5173. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5174. elif (GetTarget() == 'windows'):
  5175. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5176. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5177. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5178. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5179. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5180. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5181. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5182. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5183. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5184. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5185. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5186. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5187. if (RTDIST):
  5188. 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']
  5189. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5190. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5191. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5192. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5193. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5194. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5195. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5196. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5197. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5198. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5199. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5200. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5201. if (GetTarget() == 'darwin'):
  5202. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5203. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5204. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5205. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5206. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5207. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5208. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5209. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5210. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5211. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5212. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5213. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5214. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5215. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5216. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5217. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5218. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5219. if GetTarget() == 'darwin':
  5220. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5221. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5222. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5223. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5224. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5225. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5226. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5227. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5228. if GetTarget() == 'darwin':
  5229. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5230. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5231. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5232. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5233. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5234. if GetTarget() == 'windows':
  5235. OPTS.append("P3DEMBEDW")
  5236. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5237. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5238. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5239. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5240. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5241. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5242. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5243. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5244. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5245. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5246. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5247. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5248. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5249. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5250. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5251. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5252. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5253. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5254. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5255. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5256. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5257. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5258. #
  5259. # DIRECTORY: pandatool/src/pandatoolbase/
  5260. #
  5261. if (PkgSkip("PANDATOOL")==0):
  5262. OPTS=['DIR:pandatool/src/pandatoolbase']
  5263. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5264. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5265. #
  5266. # DIRECTORY: pandatool/src/converter/
  5267. #
  5268. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5269. OPTS=['DIR:pandatool/src/converter']
  5270. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5271. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5272. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5273. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5274. #
  5275. # DIRECTORY: pandatool/src/progbase/
  5276. #
  5277. if not PkgSkip("PANDATOOL"):
  5278. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5279. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5280. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5281. #
  5282. # DIRECTORY: pandatool/src/eggbase/
  5283. #
  5284. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5285. OPTS=['DIR:pandatool/src/eggbase']
  5286. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5287. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5288. #
  5289. # DIRECTORY: pandatool/src/bam/
  5290. #
  5291. if not PkgSkip("PANDATOOL"):
  5292. OPTS=['DIR:pandatool/src/bam']
  5293. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5294. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5295. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5296. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5297. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5298. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5299. if not PkgSkip("EGG"):
  5300. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5301. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5302. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5303. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5304. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5305. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5306. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5307. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5308. #
  5309. # DIRECTORY: pandatool/src/cvscopy/
  5310. #
  5311. if not PkgSkip("PANDATOOL"):
  5312. OPTS=['DIR:pandatool/src/cvscopy']
  5313. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5314. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5315. #
  5316. # DIRECTORY: pandatool/src/daeegg/
  5317. #
  5318. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5319. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5320. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5321. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5322. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5323. #
  5324. # DIRECTORY: pandatool/src/assimp
  5325. #
  5326. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5327. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5328. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5329. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5330. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5331. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5332. #
  5333. # DIRECTORY: pandatool/src/daeprogs/
  5334. #
  5335. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5336. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5337. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5338. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5339. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5340. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5341. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5342. #
  5343. # DIRECTORY: pandatool/src/dxf/
  5344. #
  5345. if not PkgSkip("PANDATOOL"):
  5346. OPTS=['DIR:pandatool/src/dxf']
  5347. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5348. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5349. #
  5350. # DIRECTORY: pandatool/src/dxfegg/
  5351. #
  5352. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5353. OPTS=['DIR:pandatool/src/dxfegg']
  5354. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5355. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5356. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5357. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5358. #
  5359. # DIRECTORY: pandatool/src/dxfprogs/
  5360. #
  5361. if not PkgSkip("PANDATOOL"):
  5362. OPTS=['DIR:pandatool/src/dxfprogs']
  5363. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5364. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5365. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5366. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5367. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5368. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5369. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5370. if not PkgSkip("EGG"):
  5371. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5372. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5373. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5374. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5375. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5376. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5377. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5378. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5379. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5380. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5381. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5382. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5383. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5384. #
  5385. # DIRECTORY: pandatool/src/objegg/
  5386. #
  5387. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5388. OPTS=['DIR:pandatool/src/objegg']
  5389. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5390. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5391. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5392. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5393. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5394. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5395. #
  5396. # DIRECTORY: pandatool/src/objprogs/
  5397. #
  5398. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5399. OPTS=['DIR:pandatool/src/objprogs']
  5400. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5401. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5402. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5403. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5404. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5405. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5406. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5407. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5408. #
  5409. # DIRECTORY: pandatool/src/palettizer/
  5410. #
  5411. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5412. OPTS=['DIR:pandatool/src/palettizer']
  5413. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5414. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5415. #
  5416. # DIRECTORY: pandatool/src/egg-mkfont/
  5417. #
  5418. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5419. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5420. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5421. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5422. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5423. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5424. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5425. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5426. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5427. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5428. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5429. #
  5430. # DIRECTORY: pandatool/src/eggcharbase/
  5431. #
  5432. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5433. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5434. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5435. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5436. #
  5437. # DIRECTORY: pandatool/src/egg-optchar/
  5438. #
  5439. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5440. OPTS=['DIR:pandatool/src/egg-optchar']
  5441. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5442. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5443. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5444. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5445. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5446. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5447. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5448. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5449. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5450. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5451. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5452. #
  5453. # DIRECTORY: pandatool/src/egg-palettize/
  5454. #
  5455. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5456. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5457. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5458. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5459. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5460. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5461. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5462. #
  5463. # DIRECTORY: pandatool/src/egg-qtess/
  5464. #
  5465. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5466. OPTS=['DIR:pandatool/src/egg-qtess']
  5467. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5468. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5469. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5470. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5471. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5472. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5473. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5474. #
  5475. # DIRECTORY: pandatool/src/eggprogs/
  5476. #
  5477. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5478. OPTS=['DIR:pandatool/src/eggprogs']
  5479. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5480. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5481. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5482. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5483. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5484. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5485. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5486. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5487. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5488. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5489. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5490. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5491. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5492. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5493. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5494. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5495. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5496. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5497. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5498. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5499. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5500. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5501. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5502. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5503. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5504. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5505. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5506. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5507. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5508. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5509. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5510. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5511. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5512. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5513. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5514. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5515. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5516. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5517. #
  5518. # DIRECTORY: pandatool/src/flt/
  5519. #
  5520. if not PkgSkip("PANDATOOL"):
  5521. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5522. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5523. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5524. #
  5525. # DIRECTORY: pandatool/src/fltegg/
  5526. #
  5527. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5528. OPTS=['DIR:pandatool/src/fltegg']
  5529. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5530. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5531. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5532. #
  5533. # DIRECTORY: pandatool/src/fltprogs/
  5534. #
  5535. if not PkgSkip("PANDATOOL"):
  5536. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5537. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5538. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5539. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5540. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5541. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5542. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5543. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5544. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5545. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5546. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5547. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5548. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5549. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5550. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5551. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5552. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5553. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5554. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5555. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5556. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5557. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5558. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5559. if not PkgSkip("EGG"):
  5560. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5561. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5562. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5563. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5564. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5565. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5566. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5567. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5568. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5569. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5570. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5571. #
  5572. # DIRECTORY: pandatool/src/imagebase/
  5573. #
  5574. if not PkgSkip("PANDATOOL"):
  5575. OPTS=['DIR:pandatool/src/imagebase']
  5576. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5577. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5578. #
  5579. # DIRECTORY: pandatool/src/imageprogs/
  5580. #
  5581. if not PkgSkip("PANDATOOL"):
  5582. OPTS=['DIR:pandatool/src/imageprogs']
  5583. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5584. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5585. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5586. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5587. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5588. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5589. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5590. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5591. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5592. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5593. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5594. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5595. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5596. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5597. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5598. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5599. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5600. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5601. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5602. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5603. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5604. #
  5605. # DIRECTORY: pandatool/src/pfmprogs/
  5606. #
  5607. if not PkgSkip("PANDATOOL"):
  5608. OPTS=['DIR:pandatool/src/pfmprogs']
  5609. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5610. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5611. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5612. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5613. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5614. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5615. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5616. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5617. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5618. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5619. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5620. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5621. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5622. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5623. #
  5624. # DIRECTORY: pandatool/src/lwo/
  5625. #
  5626. if not PkgSkip("PANDATOOL"):
  5627. OPTS=['DIR:pandatool/src/lwo']
  5628. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5629. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5630. #
  5631. # DIRECTORY: pandatool/src/lwoegg/
  5632. #
  5633. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5634. OPTS=['DIR:pandatool/src/lwoegg']
  5635. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5636. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5637. #
  5638. # DIRECTORY: pandatool/src/lwoprogs/
  5639. #
  5640. if not PkgSkip("PANDATOOL"):
  5641. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5642. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5643. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5644. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5645. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5646. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5647. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5648. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5649. if not PkgSkip("EGG"):
  5650. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5651. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5652. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5653. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5654. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5655. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5656. #
  5657. # DIRECTORY: pandatool/src/maya/
  5658. #
  5659. for VER in MAYAVERSIONS:
  5660. VNUM=VER[4:]
  5661. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5662. OPTS=['DIR:pandatool/src/maya', VER]
  5663. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5664. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5665. #
  5666. # DIRECTORY: pandatool/src/mayaegg/
  5667. #
  5668. for VER in MAYAVERSIONS:
  5669. VNUM=VER[4:]
  5670. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5671. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5672. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5673. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5674. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5675. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5676. #
  5677. # DIRECTORY: pandatool/src/maxegg/
  5678. #
  5679. for VER in MAXVERSIONS:
  5680. VNUM=VER[3:]
  5681. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5682. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5683. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5684. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5685. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5686. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5687. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5688. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5689. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5690. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5691. #
  5692. # DIRECTORY: pandatool/src/maxprogs/
  5693. #
  5694. for VER in MAXVERSIONS:
  5695. VNUM=VER[3:]
  5696. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5697. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5698. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5699. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5700. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5701. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5702. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5703. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5704. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5705. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5706. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5707. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5708. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5709. #
  5710. # DIRECTORY: pandatool/src/vrml/
  5711. #
  5712. if not PkgSkip("PANDATOOL"):
  5713. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5714. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5715. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5716. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5717. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5718. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5719. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5720. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5721. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5722. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5723. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5724. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5725. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5726. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5727. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5728. #
  5729. # DIRECTORY: pandatool/src/vrmlegg/
  5730. #
  5731. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5732. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5733. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5734. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5735. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5736. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5737. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5738. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5739. #
  5740. # DIRECTORY: pandatool/src/xfile/
  5741. #
  5742. if not PkgSkip("PANDATOOL"):
  5743. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5744. CreateFile(GetOutputDir()+"/include/xParser.h")
  5745. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5746. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5747. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5748. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5749. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5750. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5751. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5752. #
  5753. # DIRECTORY: pandatool/src/xfileegg/
  5754. #
  5755. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5756. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5757. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5758. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5759. #
  5760. # DIRECTORY: pandatool/src/ptloader/
  5761. #
  5762. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5763. if not PkgSkip("FCOLLADA"):
  5764. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5765. 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']
  5766. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5767. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5768. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5769. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5770. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5771. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5772. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5773. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5774. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5775. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5776. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5777. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5778. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5779. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5780. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5781. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5782. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5783. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5784. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5785. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5786. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5787. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5788. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5789. #
  5790. # DIRECTORY: pandatool/src/miscprogs/
  5791. #
  5792. # This is a bit of an esoteric tool, and it causes issues because
  5793. # it conflicts with tools of the same name in different packages.
  5794. #if (PkgSkip("PANDATOOL")==0):
  5795. # OPTS=['DIR:pandatool/src/miscprogs']
  5796. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5797. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5798. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5799. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5800. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5801. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5802. #
  5803. # DIRECTORY: pandatool/src/pstatserver/
  5804. #
  5805. if (PkgSkip("PANDATOOL")==0):
  5806. OPTS=['DIR:pandatool/src/pstatserver']
  5807. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5808. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5809. #
  5810. # DIRECTORY: pandatool/src/text-stats/
  5811. #
  5812. if (PkgSkip("PANDATOOL")==0):
  5813. OPTS=['DIR:pandatool/src/text-stats']
  5814. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5815. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5816. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5817. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5818. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5819. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5820. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5821. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5822. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5823. #
  5824. # DIRECTORY: pandatool/src/vrmlprogs/
  5825. #
  5826. if not PkgSkip("PANDATOOL"):
  5827. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5828. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5829. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5830. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5831. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5832. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5833. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5834. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5835. if not PkgSkip("EGG"):
  5836. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5837. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5838. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5839. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5840. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5841. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5842. #
  5843. # DIRECTORY: pandatool/src/win-stats/
  5844. # DIRECTORY: pandatool/src/gtk-stats/
  5845. #
  5846. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5847. if GetTarget() == 'windows':
  5848. OPTS=['DIR:pandatool/src/win-stats']
  5849. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5850. else:
  5851. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5852. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5853. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5854. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5855. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5856. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5857. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5858. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5859. #
  5860. # DIRECTORY: pandatool/src/xfileprogs/
  5861. #
  5862. if not PkgSkip("PANDATOOL"):
  5863. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5864. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5865. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5866. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5867. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5868. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5869. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5870. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5871. if not PkgSkip("EGG"):
  5872. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5873. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5874. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5875. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5876. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5877. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5878. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5879. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5880. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5881. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5882. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5883. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5884. #
  5885. # DIRECTORY: pandatool/src/mayaprogs/
  5886. #
  5887. for VER in MAYAVERSIONS:
  5888. VNUM = VER[4:]
  5889. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5890. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5891. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5892. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5893. continue
  5894. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5895. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5896. elif GetTarget() == 'darwin':
  5897. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5898. else:
  5899. ARCH_OPTS = []
  5900. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5901. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5902. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5903. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5904. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5905. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5906. #if GetTarget() == 'windows':
  5907. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5908. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5909. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5910. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5911. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5912. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5913. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5914. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5915. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5916. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5917. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5918. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5919. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5920. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5921. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5922. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5923. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5924. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5925. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5926. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5927. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5928. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5929. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5930. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5931. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5932. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5933. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5934. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5935. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5936. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5937. if GetTarget() == 'windows':
  5938. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5939. else:
  5940. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5941. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5942. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5943. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5944. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5945. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5946. if GetTarget() == 'windows':
  5947. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5948. else:
  5949. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5950. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5951. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5952. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5953. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5954. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5955. if GetTarget() == 'windows':
  5956. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5957. else:
  5958. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5959. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5960. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5961. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5962. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5963. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5964. if GetTarget() == 'windows':
  5965. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5966. else:
  5967. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5968. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5969. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5970. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5971. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5972. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5973. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5974. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5975. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5976. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5977. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5978. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5979. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5980. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5981. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5982. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5983. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5984. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5985. #
  5986. # DIRECTORY: contrib/src/ai/
  5987. #
  5988. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5989. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5990. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5991. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5992. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5993. OPTS=['DIR:contrib/src/ai']
  5994. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5995. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5996. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5997. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5998. PyTargetAdd('ai_module.obj', opts=OPTS)
  5999. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  6000. PyTargetAdd('ai.pyd', input='ai_module.obj')
  6001. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  6002. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  6003. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  6004. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  6005. #
  6006. # DIRECTORY: contrib/src/rplight/
  6007. #
  6008. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  6009. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  6010. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  6011. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  6012. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  6013. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  6014. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  6015. PyTargetAdd('rplight_module.obj', opts=OPTS)
  6016. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  6017. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  6018. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  6019. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  6020. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  6021. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  6022. #
  6023. # DIRECTORY: pandatool/src/deploy-stub
  6024. #
  6025. if PkgSkip("PYTHON") == 0:
  6026. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  6027. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  6028. if GetTarget() == 'windows':
  6029. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  6030. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  6031. # Setup rpath so libs can be found in the same directory as the deployed game
  6032. LibName('DEPLOYSTUB', "-Wl,--disable-new-dtags,-rpath,\\$ORIGIN")
  6033. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  6034. LibName('DEPLOYSTUB', "-rdynamic")
  6035. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  6036. if GetTarget() == 'windows':
  6037. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  6038. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6039. if GetTarget() == 'windows':
  6040. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  6041. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  6042. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6043. elif GetTarget() == 'darwin':
  6044. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  6045. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  6046. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  6047. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  6048. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  6049. #
  6050. # Generate the models directory and samples directory
  6051. #
  6052. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  6053. model_extensions = ["*.egg"]
  6054. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  6055. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  6056. model_extensions.append("*.flt")
  6057. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  6058. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6059. newname = model[:-4] + ".egg.pz"
  6060. else:
  6061. newname = model[:-4] + ".egg"
  6062. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  6063. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6064. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6065. newname = model[:-4] + ".egg.pz"
  6066. else:
  6067. newname = model[:-4] + ".egg"
  6068. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6069. for model in GetDirectoryContents("models", model_extensions):
  6070. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6071. newname = model[:-4] + ".egg.pz"
  6072. else:
  6073. newname = model[:-4] + ".egg"
  6074. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6075. if not PkgSkip("DIRECT") and not RUNTIME:
  6076. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6077. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6078. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6079. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6080. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6081. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6082. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6083. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6084. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6085. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6086. #
  6087. # Build the rtdist.
  6088. #
  6089. if (RTDIST):
  6090. OPTS=['DIR:direct/src/p3d']
  6091. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6092. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6093. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6094. #
  6095. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6096. #
  6097. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6098. OPTS=['DIR:direct/src/p3d']
  6099. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6100. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6101. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6102. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6103. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6104. ##########################################################################################
  6105. #
  6106. # Dependency-Based Distributed Build System.
  6107. #
  6108. ##########################################################################################
  6109. DEPENDENCYQUEUE=[]
  6110. for target in TARGET_LIST:
  6111. name = target.name
  6112. inputs = target.inputs
  6113. opts = target.opts
  6114. deps = target.deps
  6115. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6116. def BuildWorker(taskqueue, donequeue):
  6117. while True:
  6118. try:
  6119. task = taskqueue.get(timeout=1)
  6120. except:
  6121. ProgressOutput(None, "Waiting for tasks...")
  6122. task = taskqueue.get()
  6123. sys.stdout.flush()
  6124. if (task == 0): return
  6125. try:
  6126. task[0](*task[1])
  6127. donequeue.put(task)
  6128. except:
  6129. donequeue.put(0)
  6130. def AllSourcesReady(task, pending):
  6131. sources = task[3]
  6132. for x in sources:
  6133. if (x in pending):
  6134. return 0
  6135. sources = task[1][1]
  6136. for x in sources:
  6137. if (x in pending):
  6138. return 0
  6139. altsources = task[4]
  6140. for x in altsources:
  6141. if (x in pending):
  6142. return 0
  6143. return 1
  6144. def ParallelMake(tasklist):
  6145. # Create the communication queues.
  6146. donequeue = queue.Queue()
  6147. taskqueue = queue.Queue()
  6148. # Build up a table listing all the pending targets
  6149. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6150. # task[2] = [name]
  6151. # task[3] = deps
  6152. # The python tool package, in particular fltegg seems to throw parallelmake off
  6153. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6154. # and another subpart to be built sequentially. The most time consuming part of the process
  6155. # is the c++ code generation anyways.
  6156. tasklist_seq = []
  6157. i = 0
  6158. while i < len(tasklist):
  6159. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6160. break
  6161. i += 1
  6162. if i < len(tasklist):
  6163. tasklist_seq = tasklist[i:]
  6164. tasklist = tasklist[:i]
  6165. iNumStartingTasks = len(tasklist)
  6166. pending = {}
  6167. for task in tasklist:
  6168. for target in task[2]:
  6169. pending[target] = 1
  6170. # Create the workers
  6171. for slave in range(THREADCOUNT):
  6172. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6173. th.daemon = True
  6174. th.start()
  6175. # Feed tasks to the workers.
  6176. tasksqueued = 0
  6177. while True:
  6178. if (tasksqueued < THREADCOUNT):
  6179. extras = []
  6180. for task in tasklist:
  6181. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6182. if (NeedsBuild(task[2], task[3])):
  6183. tasksqueued += 1
  6184. taskqueue.put(task)
  6185. else:
  6186. for target in task[2]:
  6187. del pending[target]
  6188. else:
  6189. extras.append(task)
  6190. tasklist = extras
  6191. sys.stdout.flush()
  6192. if (tasksqueued == 0): break
  6193. donetask = donequeue.get()
  6194. if (donetask == 0):
  6195. exit("Build process aborting.")
  6196. sys.stdout.flush()
  6197. tasksqueued -= 1
  6198. JustBuilt(donetask[2], donetask[3])
  6199. for target in donetask[2]:
  6200. del pending[target]
  6201. # Kill the workers.
  6202. for slave in range(THREADCOUNT):
  6203. taskqueue.put(0)
  6204. # Make sure there aren't any unsatisfied tasks
  6205. if len(tasklist) > 0:
  6206. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6207. SequentialMake(tasklist_seq)
  6208. def SequentialMake(tasklist):
  6209. i = 0
  6210. for task in tasklist:
  6211. if (NeedsBuild(task[2], task[3])):
  6212. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6213. JustBuilt(task[2], task[3])
  6214. i += 1
  6215. def RunDependencyQueue(tasklist):
  6216. if (THREADCOUNT!=0):
  6217. ParallelMake(tasklist)
  6218. else:
  6219. SequentialMake(tasklist)
  6220. try:
  6221. RunDependencyQueue(DEPENDENCYQUEUE)
  6222. finally:
  6223. SaveDependencyCache()
  6224. # Run the test suite.
  6225. if RUNTESTS:
  6226. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6227. if sys.version_info >= (2, 6):
  6228. cmdstr += " -B"
  6229. cmdstr += " -m pytest tests"
  6230. if GetVerbose():
  6231. cmdstr += " --verbose"
  6232. oscmd(cmdstr)
  6233. # Write out information about the Python versions in the built dir.
  6234. python_version_info = GetCurrentPythonVersionInfo()
  6235. UpdatePythonVersionInfoFile(python_version_info)
  6236. ##########################################################################################
  6237. #
  6238. # The Installers
  6239. #
  6240. # Under windows, we can build an 'exe' package using NSIS
  6241. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6242. # Under OSX, we can make a 'dmg' package.
  6243. #
  6244. ##########################################################################################
  6245. if INSTALLER:
  6246. ProgressOutput(100.0, "Building installer")
  6247. from makepackage import MakeInstaller
  6248. # When using the --installer flag, only install for the current version.
  6249. python_versions = []
  6250. if python_version_info:
  6251. python_versions.append(python_version_info)
  6252. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6253. optimize=GetOptimize(), compressor=COMPRESSOR,
  6254. debversion=DEBVERSION, rpmversion=RPMVERSION, rpmrelease=RPMRELEASE,
  6255. runtime=RUNTIME, python_versions=python_versions)
  6256. if WHEEL:
  6257. ProgressOutput(100.0, "Building wheel")
  6258. from makewheel import makewheel
  6259. makewheel(WHLVERSION, GetOutputDir())
  6260. ##########################################################################################
  6261. #
  6262. # Print final status report.
  6263. #
  6264. ##########################################################################################
  6265. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6266. printStatus("Makepanda Final Status Report", WARNINGS)
  6267. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())