makepanda.py 312 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except KeyboardInterrupt:
  19. raise
  20. except:
  21. print("You are either using an incomplete or an old version of Python!")
  22. print("Please install the development package of Python and try again.")
  23. exit(1)
  24. from makepandacore import *
  25. from distutils.util import get_platform
  26. import time
  27. import os
  28. import sys
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMRELEASE="1"
  57. GIT_COMMIT=None
  58. P3DSUFFIX=None
  59. MAJOR_VERSION=None
  60. COREAPI_VERSION=None
  61. PLUGIN_VERSION=None
  62. OSXTARGET=None
  63. OSX_ARCHS=[]
  64. HOST_URL=None
  65. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  66. STRDXSDKVERSION = 'default'
  67. WINDOWS_SDK = None
  68. MSVC_VERSION = None
  69. BOOUSEINTELCOMPILER = False
  70. OPENCV_VER_23 = False
  71. PLATFORM = None
  72. COPY_PYTHON = True
  73. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  74. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  75. PkgListSet(["PYTHON", "DIRECT", # Python support
  76. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  77. "EGL", # OpenGL (ES) integration
  78. "EIGEN", # Linear algebra acceleration
  79. "OPENAL", "FMODEX", # Audio playback
  80. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  81. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  82. "SPEEDTREE", # SpeedTree
  83. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  84. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  85. "FREETYPE", "HARFBUZZ", # Text rendering
  86. "VRPN", "OPENSSL", # Transport
  87. "FFTW", # Algorithm helpers
  88. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  89. "GTK2", # GTK2 is used for PStats on Unix
  90. "MFC", "WX", "FLTK", # Used for web plug-in only
  91. "ROCKET", # GUI libraries
  92. "CARBON", "COCOA", # macOS toolkits
  93. "X11", # Unix platform support
  94. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  95. "SKEL", # Example SKEL project
  96. "PANDAFX", # Some distortion special lenses
  97. "PANDAPARTICLESYSTEM", # Built in particle system
  98. "CONTRIB", # Experimental
  99. "SSE2", "NEON", # Compiler features
  100. ])
  101. CheckPandaSourceTree()
  102. def keyboardInterruptHandler(x,y):
  103. exit("keyboard interrupt")
  104. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  105. ########################################################################
  106. ##
  107. ## Command-line parser.
  108. ##
  109. ## You can type "makepanda --help" to see all the options.
  110. ##
  111. ########################################################################
  112. def usage(problem):
  113. if (problem):
  114. print("")
  115. print("Error parsing command-line input: %s" % (problem))
  116. print("")
  117. print("Makepanda generates a 'built' subdirectory containing a")
  118. print("compiled copy of Panda3D. Command-line arguments are:")
  119. print("")
  120. print(" --help (print the help message you're reading now)")
  121. print(" --verbose (print out more information)")
  122. print(" --runtime (build a runtime build instead of an SDK build)")
  123. print(" --tests (run the test suite)")
  124. print(" --installer (build an installer)")
  125. print(" --wheel (build a pip-installable .whl)")
  126. print(" --optimize X (optimization level can be 1,2,3,4)")
  127. print(" --version X (set the panda version number)")
  128. print(" --lzma (use lzma compression when building Windows installer)")
  129. print(" --distributor X (short string identifying the distributor of the build)")
  130. print(" --outputdir X (use the specified directory instead of 'built')")
  131. print(" --host URL (set the host url (runtime build only))")
  132. print(" --threads N (use the multithreaded build system. see manual)")
  133. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  134. print(" --universal (build universal binaries (macOS only))")
  135. print(" --override \"O=V\" (override dtool_config/prc option value)")
  136. print(" --static (builds libraries for static linking)")
  137. print(" --target X (experimental cross-compilation (android only))")
  138. print(" --arch X (target architecture for cross-compilation)")
  139. print("")
  140. for pkg in PkgListGet():
  141. p = pkg.lower()
  142. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  143. if sys.platform != 'win32':
  144. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  145. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  146. print("")
  147. print(" --nothing (disable every third-party lib)")
  148. print(" --everything (enable every third-party lib)")
  149. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  150. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  151. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
  152. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  153. print("")
  154. print("The simplest way to compile panda is to just type:")
  155. print("")
  156. print(" makepanda --everything")
  157. print("")
  158. os._exit(1)
  159. def parseopts(args):
  160. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  161. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  162. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  163. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  164. global COPY_PYTHON
  165. # Options for which to display a deprecation warning.
  166. removedopts = [
  167. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  168. ]
  169. # All recognized options.
  170. longopts = [
  171. "help","distributor=","verbose","runtime","osxtarget=","tests",
  172. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  173. "version=","lzma","no-python","threads=","outputdir=","override=",
  174. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  175. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  176. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  177. "cggl-incdir=", "cggl-libdir=",
  178. ] + removedopts
  179. anything = 0
  180. optimize = ""
  181. target = None
  182. target_archs = []
  183. universal = False
  184. clean_build = False
  185. for pkg in PkgListGet():
  186. longopts.append("use-" + pkg.lower())
  187. longopts.append("no-" + pkg.lower())
  188. longopts.append(pkg.lower() + "-incdir=")
  189. longopts.append(pkg.lower() + "-libdir=")
  190. try:
  191. opts, extras = getopt.getopt(args, "", longopts)
  192. for option, value in opts:
  193. if (option=="--help"): raise Exception
  194. elif (option=="--optimize"): optimize=value
  195. elif (option=="--installer"): INSTALLER=1
  196. elif (option=="--tests"): RUNTESTS=1
  197. elif (option=="--wheel"): WHEEL=1
  198. elif (option=="--verbose"): SetVerbose(True)
  199. elif (option=="--distributor"): DISTRIBUTOR=value
  200. elif (option=="--rtdist"): RTDIST=1
  201. elif (option=="--runtime"): RUNTIME=1
  202. elif (option=="--genman"): GENMAN=1
  203. elif (option=="--everything"): PkgEnableAll()
  204. elif (option=="--nothing"): PkgDisableAll()
  205. elif (option=="--threads"): THREADCOUNT=int(value)
  206. elif (option=="--outputdir"): SetOutputDir(value.strip())
  207. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  208. elif (option=="--universal"): universal = True
  209. elif (option=="--target"): target = value.strip()
  210. elif (option=="--arch"): target_archs.append(value.strip())
  211. elif (option=="--nocolor"): DisableColors()
  212. elif (option=="--version"):
  213. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  214. if not match:
  215. usage("version requires three digits")
  216. WHLVERSION = value
  217. VERSION = match.group()
  218. elif (option=="--lzma"): COMPRESSOR="lzma"
  219. elif (option=="--override"): AddOverride(value.strip())
  220. elif (option=="--static"): SetLinkAllStatic(True)
  221. elif (option=="--host"): HOST_URL=value
  222. elif (option=="--debversion"): DEBVERSION=value
  223. elif (option=="--rpmrelease"): RPMRELEASE=value
  224. elif (option=="--git-commit"): GIT_COMMIT=value
  225. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  226. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  227. # Backward compatibility, OPENGL was renamed to GL
  228. elif (option=="--use-opengl"): PkgEnable("GL")
  229. elif (option=="--no-opengl"): PkgDisable("GL")
  230. elif (option=="--directx-sdk"):
  231. STRDXSDKVERSION = value.strip().lower()
  232. if STRDXSDKVERSION == '':
  233. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  234. STRDXSDKVERSION = 'default'
  235. elif (option=="--windows-sdk"):
  236. WINDOWS_SDK = value.strip().lower()
  237. elif (option=="--msvc-version"):
  238. MSVC_VERSION = value.strip().lower()
  239. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  240. elif (option=="--clean"): clean_build = True
  241. elif (option=="--no-copy-python"): COPY_PYTHON = False
  242. elif (option[2:] in removedopts):
  243. Warn("Ignoring removed option %s" % (option))
  244. else:
  245. for pkg in PkgListGet() + ['CGGL']:
  246. if option == "--use-" + pkg.lower():
  247. PkgEnable(pkg)
  248. break
  249. elif option == "--no-" + pkg.lower():
  250. PkgDisable(pkg)
  251. break
  252. elif option == "--" + pkg.lower() + "-incdir":
  253. PkgSetCustomLocation(pkg)
  254. IncDirectory(pkg, value)
  255. break
  256. elif option == "--" + pkg.lower() + "-libdir":
  257. PkgSetCustomLocation(pkg)
  258. LibDirectory(pkg, value)
  259. break
  260. if (option == "--everything" or option.startswith("--use-")
  261. or option == "--nothing" or option.startswith("--no-")):
  262. anything = 1
  263. except:
  264. usage(sys.exc_info()[1])
  265. if not anything:
  266. if RUNTIME:
  267. PkgEnableAll()
  268. else:
  269. usage("You should specify a list of packages to use or --everything to enable all packages.")
  270. if (RTDIST and RUNTIME):
  271. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  272. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  273. elif (optimize==""): optimize = "3"
  274. if OSXTARGET:
  275. parts = OSXTARGET.strip().split('.')
  276. try:
  277. assert len(parts) <= 2
  278. maj = int(parts[0])
  279. min = 0
  280. if len(parts) > 1:
  281. min = int(parts[1])
  282. OSXTARGET = maj, min
  283. assert OSXTARGET >= (10, 4)
  284. except:
  285. usage("Invalid setting for --osxtarget")
  286. else:
  287. OSXTARGET = None
  288. if target is not None or target_archs:
  289. SetTarget(target, target_archs[-1] if target_archs else None)
  290. if universal:
  291. if target_archs:
  292. exit("--universal is incompatible with --arch")
  293. if OSXTARGET:
  294. osxver = OSXTARGET
  295. else:
  296. maj, min = platform.mac_ver()[0].split('.')[:2]
  297. osxver = int(maj), int(min)
  298. if osxver < (10, 15):
  299. OSX_ARCHS.append("i386")
  300. if osxver < (10, 6):
  301. OSX_ARCHS.append("ppc")
  302. else:
  303. OSX_ARCHS.append("x86_64")
  304. if osxver >= (11, 0):
  305. OSX_ARCHS.append("arm64")
  306. elif target_archs:
  307. OSX_ARCHS = target_archs
  308. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  309. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  310. try:
  311. SetOptimize(int(optimize))
  312. assert GetOptimize() in [1, 2, 3, 4]
  313. except:
  314. usage("Invalid setting for OPTIMIZE")
  315. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  316. usage("Invalid SHA-1 hash given for --git-commit option!")
  317. if GetTarget() == 'windows':
  318. if not MSVC_VERSION:
  319. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  320. MSVC_VERSION = (14, 0)
  321. else:
  322. try:
  323. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  324. if (len(MSVC_VERSION) == 1):
  325. MSVC_VERSION += (0,)
  326. except:
  327. usage("Invalid setting for --msvc-version")
  328. if MSVC_VERSION < (14, 0):
  329. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  330. print("=========================================================================")
  331. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  332. print(warn_prefix + "For more information, or any questions, please visit:")
  333. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  334. print("=========================================================================")
  335. sys.stdout.flush()
  336. time.sleep(1.0)
  337. sys.exit(1)
  338. if not WINDOWS_SDK:
  339. print("No Windows SDK version specified. Defaulting to '7.1'.")
  340. WINDOWS_SDK = '7.1'
  341. if clean_build and os.path.isdir(GetOutputDir()):
  342. print("Deleting %s" % (GetOutputDir()))
  343. shutil.rmtree(GetOutputDir())
  344. parseopts(sys.argv[1:])
  345. ########################################################################
  346. ##
  347. ## Handle environment variables.
  348. ##
  349. ########################################################################
  350. if ("CFLAGS" in os.environ):
  351. CFLAGS = os.environ["CFLAGS"].strip()
  352. if ("CXXFLAGS" in os.environ):
  353. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  354. if ("RPM_OPT_FLAGS" in os.environ):
  355. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  356. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  357. if ("LDFLAGS" in os.environ):
  358. LDFLAGS = os.environ["LDFLAGS"].strip()
  359. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  360. if GetHost() == "darwin" and OSXTARGET is not None:
  361. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  362. ########################################################################
  363. ##
  364. ## Configure things based on the command-line parameters.
  365. ##
  366. ########################################################################
  367. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  368. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  369. if VERSION is None:
  370. if RUNTIME:
  371. VERSION = PLUGIN_VERSION
  372. else:
  373. # Take the value from the setup.cfg file.
  374. VERSION = GetMetadataValue('version')
  375. if WHLVERSION is None:
  376. WHLVERSION = VERSION
  377. print("Version: %s" % VERSION)
  378. if RUNTIME or RTDIST:
  379. print("Core API Version: %s" % COREAPI_VERSION)
  380. if DEBVERSION is None:
  381. DEBVERSION = VERSION
  382. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  383. if P3DSUFFIX is None:
  384. P3DSUFFIX = MAJOR_VERSION
  385. # Now determine the distutils-style platform tag for the target system.
  386. target = GetTarget()
  387. if target == 'windows':
  388. if GetTargetArch() == 'x64':
  389. PLATFORM = 'win-amd64'
  390. else:
  391. PLATFORM = 'win32'
  392. elif target == 'darwin':
  393. if OSXTARGET:
  394. osxver = OSXTARGET
  395. else:
  396. maj, min = platform.mac_ver()[0].split('.')[:2]
  397. osxver = int(maj), int(min)
  398. if osxver[0] == 11:
  399. # I think Python pins minor version to 0 from macOS 11 onward
  400. osxver = (osxver[0], 0)
  401. arch_tag = None
  402. if not OSX_ARCHS:
  403. arch_tag = GetTargetArch()
  404. elif len(OSX_ARCHS) == 1:
  405. arch_tag = OSX_ARCHS[0]
  406. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  407. arch_tag = 'fat'
  408. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  409. arch_tag = 'intel'
  410. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  411. arch_tag = 'fat64'
  412. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  413. arch_tag = 'fat32'
  414. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  415. arch_tag = 'universal'
  416. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  417. arch_tag = 'universal2'
  418. else:
  419. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  420. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  421. 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"):
  422. # This is manylinux1. A bit of a sloppy check, though.
  423. if GetTargetArch() in ('x86_64', 'amd64'):
  424. PLATFORM = 'manylinux1-x86_64'
  425. else:
  426. PLATFORM = 'manylinux1-i686'
  427. 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"):
  428. # Same sloppy check for manylinux2010.
  429. if GetTargetArch() in ('x86_64', 'amd64'):
  430. PLATFORM = 'manylinux2010-x86_64'
  431. else:
  432. PLATFORM = 'manylinux2010-i686'
  433. 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"):
  434. # Same sloppy check for manylinux2014.
  435. if GetTargetArch() in ('x86_64', 'amd64'):
  436. PLATFORM = 'manylinux2014-x86_64'
  437. else:
  438. PLATFORM = 'manylinux2014-i686'
  439. elif not CrossCompiling():
  440. if HasTargetArch():
  441. # Replace the architecture in the platform string.
  442. platform_parts = get_platform().rsplit('-', 1)
  443. target_arch = GetTargetArch()
  444. if target_arch == 'amd64':
  445. target_arch = 'x86_64'
  446. PLATFORM = platform_parts[0] + '-' + target_arch
  447. else:
  448. # We're not cross-compiling; just take the host arch.
  449. PLATFORM = get_platform()
  450. else:
  451. target_arch = GetTargetArch()
  452. if target_arch == 'amd64':
  453. target_arch = 'x86_64'
  454. PLATFORM = '{0}-{1}'.format(target, target_arch)
  455. print("Platform: %s" % PLATFORM)
  456. outputdir_suffix = ""
  457. if (RUNTIME or RTDIST):
  458. # Compiling Maya/Max is pointless in rtdist build
  459. for ver in MAYAVERSIONS + MAXVERSIONS:
  460. PkgDisable(ver)
  461. if (DISTRIBUTOR.strip() == ""):
  462. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  463. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  464. if (RUNTIME):
  465. outputdir_suffix += "_rt"
  466. if DISTRIBUTOR == "":
  467. DISTRIBUTOR = "makepanda"
  468. elif not RTDIST_VERSION:
  469. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  470. if not RTDIST_VERSION:
  471. RTDIST_VERSION = "dev"
  472. if not IsCustomOutputDir():
  473. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  474. outputdir_suffix += '_x64'
  475. SetOutputDir("built" + outputdir_suffix)
  476. if (RUNTIME):
  477. for pkg in PkgListGet():
  478. if pkg in ["GTK2", "MFC"]:
  479. # Optional package(s) for runtime.
  480. pass
  481. elif pkg in ["OPENSSL", "ZLIB"]:
  482. # Required packages for runtime.
  483. if (PkgSkip(pkg)==1):
  484. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  485. else:
  486. # Unused packages for runtime.
  487. PkgDisable(pkg)
  488. if (INSTALLER and RTDIST):
  489. exit("Cannot build an installer for the rtdist build!")
  490. if (WHEEL and RUNTIME):
  491. exit("Cannot build a wheel for the runtime build!")
  492. if (WHEEL and RTDIST):
  493. exit("Cannot build a wheel for the rtdist build!")
  494. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  495. exit("Cannot build installer on Windows without python")
  496. if WHEEL and PkgSkip("PYTHON"):
  497. exit("Cannot build wheel without Python")
  498. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  499. exit("Cannot build rtdist without wx or fltk")
  500. if (RUNTIME):
  501. SetLinkAllStatic(True)
  502. if not os.path.isdir("contrib"):
  503. PkgDisable("CONTRIB")
  504. ########################################################################
  505. ##
  506. ## Load the dependency cache.
  507. ##
  508. ########################################################################
  509. LoadDependencyCache()
  510. ########################################################################
  511. ##
  512. ## Locate various SDKs.
  513. ##
  514. ########################################################################
  515. MakeBuildTree()
  516. SdkLocateDirectX(STRDXSDKVERSION)
  517. SdkLocateMaya()
  518. SdkLocateMax()
  519. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  520. SdkLocatePython(RTDIST)
  521. SdkLocateWindows(WINDOWS_SDK)
  522. SdkLocatePhysX()
  523. SdkLocateSpeedTree()
  524. SdkLocateAndroid()
  525. SdkAutoDisableDirectX()
  526. SdkAutoDisableMaya()
  527. SdkAutoDisableMax()
  528. SdkAutoDisablePhysX()
  529. SdkAutoDisableSpeedTree()
  530. if RTDIST and DISTRIBUTOR == "cmu":
  531. # Some validation checks for the CMU builds.
  532. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  533. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  534. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  535. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  536. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  537. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  538. if RTDIST and not HOST_URL:
  539. exit("You must specify a host URL when building the rtdist!")
  540. if RUNTIME and not HOST_URL:
  541. # Set this to a nice default.
  542. HOST_URL = "https://runtime.panda3d.org/"
  543. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  544. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  545. print("==========================================================================")
  546. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  547. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  548. print(warn_prefix + "Please upgrade to Python 3 now.")
  549. print("==========================================================================")
  550. sys.stdout.flush()
  551. # Give the user some time to contemplate their sins
  552. time.sleep(6.0)
  553. ########################################################################
  554. ##
  555. ## Choose a Compiler.
  556. ##
  557. ## This should also set up any environment variables needed to make
  558. ## the compiler work.
  559. ##
  560. ########################################################################
  561. if GetHost() == 'windows' and GetTarget() == 'windows':
  562. COMPILER = "MSVC"
  563. SdkLocateVisualStudio(MSVC_VERSION)
  564. else:
  565. COMPILER = "GCC"
  566. SetupBuildEnvironment(COMPILER)
  567. ########################################################################
  568. ##
  569. ## External includes, external libraries, and external defsyms.
  570. ##
  571. ########################################################################
  572. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  573. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  574. if (COMPILER == "MSVC"):
  575. PkgDisable("X11")
  576. PkgDisable("GLES")
  577. PkgDisable("GLES2")
  578. PkgDisable("EGL")
  579. PkgDisable("CARBON")
  580. PkgDisable("COCOA")
  581. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  582. if (PkgSkip("PYTHON")==0):
  583. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  584. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  585. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  586. for pkg in PkgListGet():
  587. if (PkgSkip(pkg)==0):
  588. if (pkg[:4]=="MAYA"):
  589. IncDirectory(pkg, SDK[pkg] + "/include")
  590. DefSymbol(pkg, "MAYAVERSION", pkg)
  591. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  592. elif (pkg[:3]=="MAX"):
  593. IncDirectory(pkg, SDK[pkg] + "/include")
  594. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  595. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  596. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  597. DefSymbol(pkg, "MAX", pkg)
  598. if (int(pkg[3:]) >= 2013):
  599. DefSymbol(pkg, "UNICODE", "")
  600. DefSymbol(pkg, "_UNICODE", "")
  601. elif (pkg[:2]=="DX"):
  602. IncDirectory(pkg, SDK[pkg] + "/include")
  603. elif GetThirdpartyDir() is not None:
  604. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  605. for pkg in DXVERSIONS:
  606. if (PkgSkip(pkg)==0):
  607. vnum=pkg[2:]
  608. if GetTargetArch() == 'x64':
  609. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  610. else:
  611. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  612. LibDirectory(pkg, SDK[pkg] + '/lib')
  613. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  614. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  615. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  616. LibName(pkg, 'dxerr.lib')
  617. else:
  618. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  619. #LibName(pkg, 'ddraw.lib')
  620. LibName(pkg, 'dxguid.lib')
  621. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  622. # dxerr needs this for __vsnwprintf definition.
  623. LibName(pkg, 'legacy_stdio_definitions.lib')
  624. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  625. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  626. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  627. LibName("WINSOCK", "wsock32.lib")
  628. LibName("WINSOCK2", "wsock32.lib")
  629. LibName("WINSOCK2", "ws2_32.lib")
  630. LibName("WINCOMCTL", "comctl32.lib")
  631. LibName("WINCOMDLG", "comdlg32.lib")
  632. LibName("WINUSER", "user32.lib")
  633. LibName("WINMM", "winmm.lib")
  634. LibName("WINIMM", "imm32.lib")
  635. LibName("WINKERNEL", "kernel32.lib")
  636. LibName("WINOLE", "ole32.lib")
  637. LibName("WINOLEAUT", "oleaut32.lib")
  638. LibName("WINOLDNAMES", "oldnames.lib")
  639. LibName("WINSHELL", "shell32.lib")
  640. LibName("WINGDI", "gdi32.lib")
  641. LibName("ADVAPI", "advapi32.lib")
  642. LibName("IPHLPAPI", "iphlpapi.lib")
  643. LibName("SETUPAPI", "setupapi.lib")
  644. LibName("GL", "opengl32.lib")
  645. LibName("GLES", "libgles_cm.lib")
  646. LibName("GLES2", "libGLESv2.lib")
  647. LibName("EGL", "libEGL.lib")
  648. LibName("MSIMG", "msimg32.lib")
  649. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  650. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  651. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  652. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  653. if (PkgSkip("OPENSSL")==0):
  654. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  655. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  656. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  657. else:
  658. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  659. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  660. if (PkgSkip("PNG")==0):
  661. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  662. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  663. else:
  664. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  665. if (PkgSkip("TIFF")==0):
  666. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  667. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  668. else:
  669. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  670. if (PkgSkip("OPENEXR")==0):
  671. suffix = ""
  672. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  673. suffix = "-2_2"
  674. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  675. suffix = "-2_3"
  676. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  677. suffix = "-2_4"
  678. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  679. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  680. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  681. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  682. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  683. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  684. if suffix == "-2_2":
  685. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  686. else:
  687. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  688. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  689. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  690. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  691. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  692. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  693. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  694. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  695. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  696. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  697. if (PkgSkip("HARFBUZZ")==0):
  698. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  699. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  700. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  701. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  702. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  703. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  704. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  705. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  706. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  707. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  708. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  709. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  710. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  711. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  712. if (PkgSkip("FCOLLADA")==0):
  713. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  714. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  715. if (PkgSkip("ASSIMP")==0):
  716. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  717. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  718. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  719. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  720. if (PkgSkip("SQUISH")==0):
  721. if GetOptimize() <= 2:
  722. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  723. else:
  724. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  725. if (PkgSkip("ROCKET")==0):
  726. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  727. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  728. if (PkgSkip("PYTHON")==0):
  729. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  730. if (GetOptimize() <= 3):
  731. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  732. if (PkgSkip("OPENAL")==0):
  733. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  734. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  735. # Link OpenAL Soft statically.
  736. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  737. if (PkgSkip("ODE")==0):
  738. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  739. DefSymbol("ODE", "dSINGLE", "")
  740. if (PkgSkip("FMODEX")==0):
  741. if (GetTargetArch() == 'x64'):
  742. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  743. else:
  744. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  745. if (PkgSkip("FLTK")==0 and RTDIST):
  746. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  747. if not PkgSkip("FLTK"):
  748. # If we have fltk, we don't need wx
  749. PkgDisable("WX")
  750. if (PkgSkip("WX")==0 and RTDIST):
  751. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  752. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  753. DefSymbol("WX", "__WXMSW__", "")
  754. DefSymbol("WX", "_UNICODE", "")
  755. DefSymbol("WX", "UNICODE", "")
  756. if (PkgSkip("VORBIS")==0):
  757. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  758. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  759. if not os.path.isfile(path):
  760. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  761. LibName("VORBIS", path)
  762. if (PkgSkip("OPUS")==0):
  763. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  764. for lib in ('ogg', 'opus', 'opusfile'):
  765. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  766. if not os.path.isfile(path):
  767. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  768. LibName("OPUS", path)
  769. for pkg in MAYAVERSIONS:
  770. if (PkgSkip(pkg)==0):
  771. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  772. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  773. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  774. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  775. for pkg in MAXVERSIONS:
  776. if (PkgSkip(pkg)==0):
  777. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  778. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  779. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  780. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  781. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  782. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  783. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  784. if (PkgSkip("PHYSX")==0):
  785. if GetTargetArch() == 'x64':
  786. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  787. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  788. else:
  789. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  790. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  791. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  792. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  793. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  794. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  795. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  796. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  797. if (PkgSkip("SPEEDTREE")==0):
  798. if GetTargetArch() == 'x64':
  799. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  800. p64ext = '64'
  801. else:
  802. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  803. p64ext = ''
  804. debugext = ''
  805. if (GetOptimize() <= 2): debugext = "_d"
  806. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  807. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  808. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  809. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  810. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  811. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  812. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  813. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  814. LibName("SPEEDTREE", "glu32.lib")
  815. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  816. if (PkgSkip("BULLET")==0):
  817. suffix = '.lib'
  818. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  819. suffix = '_x64.lib'
  820. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  821. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  822. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  823. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  824. if (COMPILER=="GCC"):
  825. if GetTarget() != "darwin":
  826. PkgDisable("CARBON")
  827. PkgDisable("COCOA")
  828. elif RUNTIME:
  829. # We don't support Cocoa in the runtime yet.
  830. PkgDisable("COCOA")
  831. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  832. # 64-bits macOS doesn't have Carbon.
  833. PkgDisable("CARBON")
  834. if GetTarget() == 'darwin':
  835. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  836. # These support only these archs, so don't build them if we're not
  837. # targeting any of the supported archs.
  838. PkgDisable("FMODEX")
  839. PkgDisable("NVIDIACG")
  840. PkgDisable("ROCKET")
  841. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  842. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  843. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  844. # Also, we can't target FMOD Ex with the 10.14 SDK
  845. PkgDisable("FMODEX")
  846. #if (PkgSkip("PYTHON")==0):
  847. # IncDirectory("PYTHON", SDK["PYTHON"])
  848. if (GetHost() == "darwin"):
  849. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  850. IncDirectory("FREETYPE", "/usr/X11/include")
  851. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  852. LibDirectory("FREETYPE", "/usr/X11/lib")
  853. if (GetHost() == "freebsd"):
  854. IncDirectory("ALWAYS", "/usr/local/include")
  855. LibDirectory("ALWAYS", "/usr/local/lib")
  856. if (os.path.isdir("/usr/PCBSD")):
  857. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  858. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  859. if GetTarget() != "windows":
  860. PkgDisable("DIRECTCAM")
  861. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  862. # WARNING! The order of the ffmpeg libraries matters!
  863. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  864. assimp_libs = ("libassimp", "libassimpd")
  865. # Name pkg-config libs, include(dir)s
  866. if (not RUNTIME):
  867. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  868. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  869. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  870. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  871. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  872. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  873. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  874. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  875. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  876. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  877. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  878. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  879. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  880. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  881. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  882. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  883. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  884. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  885. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  886. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  887. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  888. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  889. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  890. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  891. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  892. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  893. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  894. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  895. # because there's a circular dependency between the two libraries.
  896. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  897. for (opt, name) in LIBNAMES:
  898. if opt == "FREETYPE":
  899. LibName("HARFBUZZ", name)
  900. if not PkgSkip("FFMPEG"):
  901. if GetTarget() == "darwin":
  902. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  903. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  904. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  905. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  906. # Needed when linking ffmpeg statically on Linux.
  907. LibName("FFMPEG", "-Wl,-Bsymbolic")
  908. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  909. for ffmpeg_lib in ffmpeg_libs:
  910. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  911. if GetTarget() != "darwin":
  912. for fcollada_lib in fcollada_libs:
  913. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  914. if not PkgSkip("SWSCALE"):
  915. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  916. if not PkgSkip("SWRESAMPLE"):
  917. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  918. if not PkgSkip("JPEG"):
  919. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  920. if not PkgSkip("TIFF"):
  921. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  922. if not PkgSkip("PNG"):
  923. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  924. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  925. if not PkgSkip("SQUISH"):
  926. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  927. if not PkgSkip("OPENEXR"):
  928. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  929. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  930. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  931. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  932. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  933. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  934. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  935. if not PkgSkip("VORBIS"):
  936. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  937. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  938. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  939. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  940. if not PkgSkip("OPUS"):
  941. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  942. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  943. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  944. if not PkgSkip("VRPN"):
  945. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  946. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  947. if not PkgSkip("ARTOOLKIT"):
  948. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  949. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  950. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  951. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  952. if cv_lib == "opencv_core":
  953. OPENCV_VER_23 = True
  954. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  955. else:
  956. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  957. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  958. else:
  959. PkgDisable("OPENCV")
  960. if not PkgSkip("OPENAL"):
  961. if GetTarget() == "darwin":
  962. LibName("OPENAL", "-framework AudioUnit")
  963. LibName("OPENAL", "-framework AudioToolbox")
  964. LibName("OPENAL", "-framework CoreAudio")
  965. else:
  966. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  967. if not PkgSkip("ASSIMP") and \
  968. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  969. # Also pick up IrrXML, which is needed when linking statically.
  970. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  971. if os.path.isfile(irrxml):
  972. LibName("ASSIMP", irrxml)
  973. if GetTarget() != "darwin":
  974. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  975. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  976. rocket_libs = ("RocketCore", "RocketControls")
  977. if (GetOptimize() <= 3):
  978. rocket_libs += ("RocketDebugger",)
  979. rocket_libs += ("boost_python",)
  980. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  981. if not PkgSkip("PYTHON"):
  982. python_lib = SDK["PYTHONVERSION"]
  983. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  984. if GetTarget() == "linux":
  985. LibName("PYTHON", "-lutil")
  986. LibName("PYTHON", "-lrt")
  987. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  988. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  989. SmartPkgEnable("GTK2", "gtk+-2.0")
  990. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  991. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  992. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  993. if (RTDIST):
  994. SmartPkgEnable("WX", tool = "wx-config")
  995. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  996. if GetTarget() != 'darwin':
  997. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  998. if not PkgSkip("NVIDIACG") and not RUNTIME:
  999. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1000. if not RUNTIME and GetTarget() != "android":
  1001. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1002. if GetHost() != "darwin":
  1003. # Workaround for an issue where pkg-config does not include this path
  1004. if GetTargetArch() in ("x86_64", "amd64"):
  1005. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1006. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1007. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1008. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1009. if not PkgSkip("X11"):
  1010. if (os.path.isdir("/usr/X11R6/lib64")):
  1011. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1012. else:
  1013. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1014. elif not PkgSkip("X11"):
  1015. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1016. if RUNTIME:
  1017. # For the runtime, these packages are required
  1018. for pkg in ["OPENSSL", "ZLIB"]:
  1019. skips = []
  1020. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1021. skips.append(pkg)
  1022. if skips:
  1023. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1024. for pkg in MAYAVERSIONS:
  1025. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1026. if (GetHost() == "darwin"):
  1027. # Sheesh, Autodesk really can't make up their mind
  1028. # regarding the location of the Maya devkit on macOS.
  1029. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1030. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1031. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1032. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1033. if (os.path.isdir(SDK[pkg] + "/lib")):
  1034. LibDirectory(pkg, SDK[pkg] + "/lib")
  1035. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1036. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1037. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1038. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1039. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1040. IncDirectory(pkg, SDK[pkg] + "/include")
  1041. else:
  1042. LibDirectory(pkg, SDK[pkg] + "/lib")
  1043. IncDirectory(pkg, SDK[pkg] + "/include")
  1044. DefSymbol(pkg, "MAYAVERSION", pkg)
  1045. if GetTarget() == 'darwin':
  1046. LibName("ALWAYS", "-framework AppKit")
  1047. LibName("AGL", "-framework AGL")
  1048. LibName("CARBON", "-framework Carbon")
  1049. LibName("COCOA", "-framework Cocoa")
  1050. # Fix for a bug in OSX Leopard:
  1051. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1052. if GetTarget() == 'android':
  1053. LibName("ALWAYS", '-llog')
  1054. LibName("ANDROID", '-landroid')
  1055. LibName("JNIGRAPHICS", '-ljnigraphics')
  1056. for pkg in MAYAVERSIONS:
  1057. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1058. if GetTarget() == 'darwin':
  1059. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1060. else:
  1061. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1062. LibName(pkg, "-lOpenMaya")
  1063. LibName(pkg, "-lOpenMayaAnim")
  1064. LibName(pkg, "-lOpenMayaUI")
  1065. LibName(pkg, "-lAnimSlice")
  1066. LibName(pkg, "-lDeformSlice")
  1067. LibName(pkg, "-lModifiers")
  1068. LibName(pkg, "-lDynSlice")
  1069. LibName(pkg, "-lKinSlice")
  1070. LibName(pkg, "-lModelSlice")
  1071. LibName(pkg, "-lNurbsSlice")
  1072. LibName(pkg, "-lPolySlice")
  1073. LibName(pkg, "-lProjectSlice")
  1074. LibName(pkg, "-lImage")
  1075. LibName(pkg, "-lShared")
  1076. LibName(pkg, "-lTranslators")
  1077. LibName(pkg, "-lDataModel")
  1078. LibName(pkg, "-lRenderModel")
  1079. LibName(pkg, "-lNurbsEngine")
  1080. LibName(pkg, "-lDependEngine")
  1081. LibName(pkg, "-lCommandEngine")
  1082. LibName(pkg, "-lFoundation")
  1083. if pkg != "MAYA2020":
  1084. LibName(pkg, "-lIMFbase")
  1085. if GetTarget() != 'darwin':
  1086. LibName(pkg, "-lOpenMayalib")
  1087. else:
  1088. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1089. if (PkgSkip("PHYSX")==0):
  1090. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1091. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1092. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1093. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1094. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1095. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1096. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1097. if (GetHost() == "darwin"):
  1098. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1099. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1100. else:
  1101. LibName("PHYSX", "-lPhysXLoader")
  1102. LibName("PHYSX", "-lNxCharacter")
  1103. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1104. if GetLinkAllStatic():
  1105. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1106. if GetTarget() == 'android':
  1107. DefSymbol("ALWAYS", "ANDROID")
  1108. if not PkgSkip("EIGEN"):
  1109. if GetOptimize() >= 3:
  1110. if COMPILER == "MSVC":
  1111. # Squeeze out a bit more performance on MSVC builds...
  1112. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1113. # will turn them into runtime assertions.
  1114. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1115. ########################################################################
  1116. ##
  1117. ## Give a Status Report on Command-Line Options
  1118. ##
  1119. ########################################################################
  1120. def printStatus(header,warnings):
  1121. if GetVerbose():
  1122. print("")
  1123. print("-------------------------------------------------------------------")
  1124. print(header)
  1125. tkeep = ""
  1126. tomit = ""
  1127. for x in PkgListGet():
  1128. if PkgSkip(x):
  1129. tomit = tomit + x + " "
  1130. else:
  1131. tkeep = tkeep + x + " "
  1132. if RTDIST:
  1133. print("Makepanda: Runtime distribution build")
  1134. elif RUNTIME:
  1135. print("Makepanda: Runtime build")
  1136. else:
  1137. print("Makepanda: Regular build")
  1138. print("Makepanda: Compiler: %s" % (COMPILER))
  1139. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1140. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1141. print("Makepanda: Omit Pkg: %s" % (tomit))
  1142. if GENMAN:
  1143. print("Makepanda: Generate API reference manual")
  1144. else:
  1145. print("Makepanda: Don't generate API reference manual")
  1146. if GetHost() == "windows" and not RTDIST:
  1147. if INSTALLER:
  1148. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1149. else:
  1150. print("Makepanda: Don't build installer")
  1151. print("Makepanda: Version ID: %s" % (VERSION))
  1152. for x in warnings:
  1153. print("Makepanda: %s" % (x))
  1154. print("-------------------------------------------------------------------")
  1155. print("")
  1156. sys.stdout.flush()
  1157. ########################################################################
  1158. ##
  1159. ## BracketNameWithQuotes
  1160. ##
  1161. ########################################################################
  1162. def BracketNameWithQuotes(name):
  1163. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1164. if (name.startswith("-framework")): return name
  1165. if (name.startswith("-dylib_file")): return name
  1166. # Don't add quotes when it's not necessary.
  1167. if " " not in name: return name
  1168. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1169. if (name.startswith('"') and name.endswith('"')): return name
  1170. else: return '"' + name + '"'
  1171. ########################################################################
  1172. ##
  1173. ## CompileCxx
  1174. ##
  1175. ########################################################################
  1176. def CompileCxx(obj,src,opts):
  1177. ipath = GetListOption(opts, "DIR:")
  1178. optlevel = GetOptimizeOption(opts)
  1179. if (COMPILER=="MSVC"):
  1180. if not BOOUSEINTELCOMPILER:
  1181. cmd = "cl "
  1182. if GetTargetArch() == 'x64':
  1183. cmd += "/favor:blend "
  1184. cmd += "/wd4996 /wd4275 /wd4273 "
  1185. # We still target Windows XP.
  1186. cmd += "/DWINVER=0x501 "
  1187. # Work around a WinXP/2003 bug when using VS 2015+.
  1188. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1189. cmd += "/Zc:threadSafeInit- "
  1190. cmd += "/Fo" + obj + " /nologo /c"
  1191. if GetTargetArch() == 'x86':
  1192. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1193. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1194. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1195. else: # x86 without SSE2
  1196. cmd += " /arch:IA32"
  1197. for x in ipath: cmd += " /I" + x
  1198. for (opt,dir) in INCDIRECTORIES:
  1199. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1200. for (opt,var,val) in DEFSYMBOLS:
  1201. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1202. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1203. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1204. if (optlevel==2): cmd += " /MDd /Zi"
  1205. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1206. if (optlevel==4):
  1207. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1208. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1209. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1210. building = GetValueOption(opts, "BUILDING:")
  1211. if (building):
  1212. cmd += " /DBUILDING_" + building
  1213. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1214. cmd += " /bigobj"
  1215. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1216. if 'EXCEPTIONS' in opts:
  1217. cmd += " /EHsc"
  1218. else:
  1219. cmd += " /D_HAS_EXCEPTIONS=0"
  1220. if 'RTTI' not in opts:
  1221. cmd += " /GR-"
  1222. if GetTargetArch() == 'x64':
  1223. cmd += " /DWIN64_VC /DWIN64"
  1224. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1225. # To preserve Windows XP compatibility.
  1226. cmd += " /D_USING_V110_SDK71_"
  1227. cmd += " /W3 " + BracketNameWithQuotes(src)
  1228. oscmd(cmd)
  1229. else:
  1230. cmd = "icl "
  1231. if GetTargetArch() == 'x64':
  1232. cmd += "/favor:blend "
  1233. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1234. cmd += "/DWINVER=0x501 "
  1235. cmd += "/Fo" + obj + " /c"
  1236. for x in ipath: cmd += " /I" + x
  1237. for (opt,dir) in INCDIRECTORIES:
  1238. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1239. for (opt,var,val) in DEFSYMBOLS:
  1240. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1241. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1242. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1243. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1244. # core changes from jean-claude (dec 2011)
  1245. # ----------------------------------------
  1246. # performance will be seeked at level 3 & 4
  1247. # -----------------------------------------
  1248. if (optlevel==3):
  1249. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1250. cmd += " /Ob0"
  1251. cmd += " /Qipo-" # beware of IPO !!!
  1252. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1253. ## ----------------------------------------------------------------
  1254. if (optlevel==4):
  1255. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1256. cmd += " /Qipo" # optimization multi file
  1257. # for 3 & 4 optimization levels
  1258. # -----------------------------
  1259. if (optlevel>=3):
  1260. cmd += " /fp:fast=2"
  1261. cmd += " /Qftz"
  1262. cmd += " /Qfp-speculation:fast"
  1263. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1264. cmd += " /Qprec-div-"
  1265. cmd += " /Qsimd"
  1266. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1267. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1268. cmd += " /Qparallel" # enable parallelization
  1269. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1270. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1271. ## PCH files with a .pchi filename suffix and reduce build time.
  1272. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1273. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1274. cmd += " /Qpchi-" # keep it this way!
  1275. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1276. ## ------------------------------------
  1277. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1278. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1279. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1280. ## Ctor displacement /vd0 : Disable constructor displacement.
  1281. ## Choose this option only if no class constructors or destructors call virtual functions.
  1282. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1283. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1284. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1285. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1286. ## Alternate: #pragma pointers_to_members
  1287. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1288. building = GetValueOption(opts, "BUILDING:")
  1289. if (building): cmd += " /DBUILDING_" + building
  1290. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1291. cmd += " /bigobj"
  1292. # level of warnings and optimization reports
  1293. if GetVerbose():
  1294. cmd += " /W3 " # or /W4 or /Wall
  1295. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1296. else:
  1297. cmd += " /W1 "
  1298. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1299. if GetTargetArch() == 'x64':
  1300. cmd += " /DWIN64_VC /DWIN64"
  1301. cmd += " " + BracketNameWithQuotes(src)
  1302. oscmd(cmd)
  1303. if (COMPILER=="GCC"):
  1304. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1305. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1306. for (opt, dir) in INCDIRECTORIES:
  1307. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1308. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1309. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1310. for (opt,var,val) in DEFSYMBOLS:
  1311. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1312. for x in ipath: cmd += ' -I' + x
  1313. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1314. cmd += ' -fvisibility=hidden'
  1315. # Mac-specific flags.
  1316. if GetTarget() == "darwin":
  1317. cmd += " -Wno-deprecated-declarations"
  1318. if OSXTARGET is not None:
  1319. cmd += " -isysroot " + SDK["MACOSX"]
  1320. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1321. elif platform.mac_ver()[0].startswith('11.'):
  1322. cmd += " -mmacosx-version-min=11.0"
  1323. for arch in OSX_ARCHS:
  1324. if 'NOARCH:' + arch.upper() not in opts:
  1325. cmd += " -arch %s" % arch
  1326. if "SYSROOT" in SDK:
  1327. if GetTarget() != "android":
  1328. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1329. else:
  1330. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1331. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1332. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1333. cmd += ' -no-canonical-prefixes'
  1334. # Android-specific flags.
  1335. arch = GetTargetArch()
  1336. if GetTarget() == "android":
  1337. # Most of the specific optimization flags here were
  1338. # just copied from the default Android Makefiles.
  1339. if "ANDROID_API" in SDK:
  1340. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1341. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1342. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1343. cmd += ' -ffunction-sections -funwind-tables'
  1344. if arch == 'armv7a':
  1345. cmd += ' -target armv7-none-linux-androideabi'
  1346. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1347. cmd += ' -fno-integrated-as'
  1348. elif arch == 'arm':
  1349. cmd += ' -target armv5te-none-linux-androideabi'
  1350. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1351. cmd += ' -fno-integrated-as'
  1352. elif arch == 'aarch64':
  1353. cmd += ' -target aarch64-none-linux-android'
  1354. elif arch == 'mips':
  1355. cmd += ' -target mipsel-none-linux-android'
  1356. cmd += ' -mips32'
  1357. elif arch == 'mips64':
  1358. cmd += ' -target mips64el-none-linux-android'
  1359. cmd += ' -fintegrated-as'
  1360. elif arch == 'x86':
  1361. cmd += ' -target i686-none-linux-android'
  1362. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1363. cmd += ' -mstackrealign'
  1364. elif arch == 'x86_64':
  1365. cmd += ' -target x86_64-none-linux-android'
  1366. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1367. cmd += " -Wa,--noexecstack"
  1368. # Do we want thumb or arm instructions?
  1369. if arch.startswith('arm'):
  1370. if optlevel >= 3:
  1371. cmd += ' -mthumb'
  1372. else:
  1373. cmd += ' -marm'
  1374. # Enable SIMD instructions if requested
  1375. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1376. cmd += ' -mfpu=neon'
  1377. else:
  1378. cmd += " -pthread"
  1379. if not src.endswith(".c"):
  1380. # We don't use exceptions for most modules.
  1381. if 'EXCEPTIONS' in opts:
  1382. cmd += " -fexceptions"
  1383. else:
  1384. cmd += " -fno-exceptions"
  1385. if src.endswith(".mm"):
  1386. # Work around Apple compiler bug.
  1387. cmd += " -U__EXCEPTIONS"
  1388. target = GetTarget()
  1389. if 'RTTI' not in opts and target != "darwin":
  1390. # We always disable RTTI on Android for memory usage reasons.
  1391. if optlevel >= 4 or target == "android":
  1392. cmd += " -fno-rtti"
  1393. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1394. cmd += " -msse2"
  1395. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1396. cmd += " -fno-strict-aliasing"
  1397. if optlevel >= 3:
  1398. cmd += " -ffast-math -fno-stack-protector"
  1399. if optlevel == 3:
  1400. # Fast math is nice, but we'd like to see NaN in dev builds.
  1401. cmd += " -fno-finite-math-only"
  1402. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1403. cmd += " -fno-unsafe-math-optimizations"
  1404. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1405. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1406. if (optlevel==3): cmd += " -O2"
  1407. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1408. # Enable more warnings.
  1409. cmd += " -Wall -Wno-unused-function"
  1410. if not src.endswith(".c"):
  1411. cmd += " -Wno-reorder"
  1412. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1413. if optlevel == 4:
  1414. cmd += " -Wno-unused-variable"
  1415. if src.endswith(".c"):
  1416. cmd += ' ' + CFLAGS
  1417. else:
  1418. cmd += ' ' + CXXFLAGS
  1419. cmd = cmd.rstrip()
  1420. building = GetValueOption(opts, "BUILDING:")
  1421. if (building): cmd += " -DBUILDING_" + building
  1422. cmd += ' ' + BracketNameWithQuotes(src)
  1423. oscmd(cmd)
  1424. ########################################################################
  1425. ##
  1426. ## CompileBison
  1427. ##
  1428. ########################################################################
  1429. def CompileBison(wobj, wsrc, opts):
  1430. ifile = os.path.basename(wsrc)
  1431. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1432. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1433. pre = GetValueOption(opts, "BISONPREFIX_")
  1434. bison = GetBison()
  1435. if bison is None:
  1436. # We don't have bison. See if there is a prebuilt file.
  1437. base, ext = os.path.splitext(wsrc)
  1438. if os.path.isfile(base + '.h.prebuilt') and \
  1439. os.path.isfile(base + '.cxx.prebuilt'):
  1440. CopyFile(wdstc, base + '.cxx.prebuilt')
  1441. CopyFile(wdsth, base + '.h.prebuilt')
  1442. else:
  1443. exit('Could not find bison!')
  1444. else:
  1445. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1446. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1447. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1448. # Finally, compile the generated source file.
  1449. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1450. ########################################################################
  1451. ##
  1452. ## CompileFlex
  1453. ##
  1454. ########################################################################
  1455. def CompileFlex(wobj,wsrc,opts):
  1456. ifile = os.path.basename(wsrc)
  1457. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1458. pre = GetValueOption(opts, "BISONPREFIX_")
  1459. dashi = opts.count("FLEXDASHI")
  1460. flex = GetFlex()
  1461. want_version = GetValueOption(opts, "FLEXVERSION:")
  1462. if flex and want_version:
  1463. # Is flex at the required version for this file?
  1464. want_version = tuple(map(int, want_version.split('.')))
  1465. have_version = GetFlexVersion()
  1466. if want_version > have_version:
  1467. Warn("Skipping flex %s for file %s, need at least %s" % (
  1468. '.'.join(map(str, have_version)),
  1469. ifile,
  1470. '.'.join(map(str, want_version)),
  1471. ))
  1472. flex = None
  1473. if flex is None:
  1474. # We don't have flex. See if there is a prebuilt file.
  1475. base, ext = os.path.splitext(wsrc)
  1476. if os.path.isfile(base + '.cxx.prebuilt'):
  1477. CopyFile(wdst, base + '.cxx.prebuilt')
  1478. else:
  1479. exit('Could not find flex!')
  1480. else:
  1481. if (dashi):
  1482. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1483. else:
  1484. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1485. # Finally, compile the generated source file.
  1486. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1487. ########################################################################
  1488. ##
  1489. ## CompileIgate
  1490. ##
  1491. ########################################################################
  1492. def CompileIgate(woutd,wsrc,opts):
  1493. outbase = os.path.basename(woutd)[:-3]
  1494. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1495. srcdir = GetValueOption(opts, "SRCDIR:")
  1496. module = GetValueOption(opts, "IMOD:")
  1497. library = GetValueOption(opts, "ILIB:")
  1498. ipath = GetListOption(opts, "DIR:")
  1499. if (PkgSkip("PYTHON")):
  1500. WriteFile(woutc, "")
  1501. WriteFile(woutd, "")
  1502. ConditionalWriteFile(woutd, "")
  1503. return
  1504. if not CrossCompiling():
  1505. # If we're compiling for this platform, we can use the one we've built.
  1506. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1507. else:
  1508. # Assume that interrogate is on the PATH somewhere.
  1509. cmd = 'interrogate'
  1510. if GetVerbose():
  1511. cmd += ' -v'
  1512. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1513. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1514. if (COMPILER=="MSVC"):
  1515. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1516. if GetTargetArch() == 'x64':
  1517. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1518. else:
  1519. cmd += ' -D_M_IX86'
  1520. # NOTE: this 1600 value is the version number for VC2010.
  1521. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1522. if (COMPILER=="GCC"):
  1523. cmd += ' -D__attribute__\\(x\\)='
  1524. target_arch = GetTargetArch()
  1525. if target_arch in ("x86_64", "amd64"):
  1526. cmd += ' -D_LP64'
  1527. elif target_arch in ('aarch64', 'arm64'):
  1528. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1529. else:
  1530. cmd += ' -D__i386__'
  1531. target = GetTarget()
  1532. if target == 'darwin':
  1533. cmd += ' -D__APPLE__'
  1534. elif target == 'android':
  1535. cmd += ' -D__ANDROID__'
  1536. optlevel = GetOptimizeOption(opts)
  1537. if (optlevel==1): cmd += ' -D_DEBUG'
  1538. if (optlevel==2): cmd += ' -D_DEBUG'
  1539. if (optlevel==3): pass
  1540. if (optlevel==4): cmd += ' -DNDEBUG'
  1541. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1542. cmd += ' -fnames -string -refcount -assert -python-native'
  1543. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1544. # Add -I, -S and -D flags
  1545. for x in ipath:
  1546. cmd += ' -I' + BracketNameWithQuotes(x)
  1547. for (opt,dir) in INCDIRECTORIES:
  1548. if (opt=="ALWAYS") or (opt in opts):
  1549. cmd += ' -S' + BracketNameWithQuotes(dir)
  1550. for (opt,var,val) in DEFSYMBOLS:
  1551. if (opt=="ALWAYS") or (opt in opts):
  1552. cmd += ' -D' + var + '=' + val
  1553. #building = GetValueOption(opts, "BUILDING:")
  1554. #if (building): cmd += " -DBUILDING_"+building
  1555. cmd += ' -module ' + module + ' -library ' + library
  1556. for x in wsrc:
  1557. if (x.startswith("/")):
  1558. cmd += ' ' + BracketNameWithQuotes(x)
  1559. else:
  1560. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1561. oscmd(cmd)
  1562. ########################################################################
  1563. ##
  1564. ## CompileImod
  1565. ##
  1566. ########################################################################
  1567. def CompileImod(wobj, wsrc, opts):
  1568. module = GetValueOption(opts, "IMOD:")
  1569. library = GetValueOption(opts, "ILIB:")
  1570. if (COMPILER=="MSVC"):
  1571. woutc = wobj[:-4]+".cxx"
  1572. if (COMPILER=="GCC"):
  1573. woutc = wobj[:-2]+".cxx"
  1574. if (PkgSkip("PYTHON")):
  1575. WriteFile(woutc, "")
  1576. CompileCxx(wobj, woutc, opts)
  1577. return
  1578. if not CrossCompiling():
  1579. # If we're compiling for this platform, we can use the one we've built.
  1580. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1581. else:
  1582. # Assume that interrogate_module is on the PATH somewhere.
  1583. cmd = 'interrogate_module'
  1584. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1585. importmod = GetValueOption(opts, "IMPORT:")
  1586. if importmod:
  1587. cmd += ' -import ' + importmod
  1588. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1589. oscmd(cmd)
  1590. CompileCxx(wobj,woutc,opts)
  1591. return
  1592. ########################################################################
  1593. ##
  1594. ## CompileLib
  1595. ##
  1596. ########################################################################
  1597. def CompileLib(lib, obj, opts):
  1598. if (COMPILER=="MSVC"):
  1599. if not BOOUSEINTELCOMPILER:
  1600. #Use MSVC Linker
  1601. cmd = 'link /lib /nologo'
  1602. if GetOptimizeOption(opts) == 4:
  1603. cmd += " /LTCG"
  1604. if HasTargetArch():
  1605. cmd += " /MACHINE:" + GetTargetArch().upper()
  1606. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1607. for x in obj:
  1608. if not x.endswith('.lib'):
  1609. cmd += ' ' + BracketNameWithQuotes(x)
  1610. oscmd(cmd)
  1611. else:
  1612. # Choose Intel linker; from Jean-Claude
  1613. cmd = 'xilink /verbose:lib /lib '
  1614. if HasTargetArch():
  1615. cmd += " /MACHINE:" + GetTargetArch().upper()
  1616. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1617. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1618. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1619. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1620. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1621. oscmd(cmd)
  1622. if (COMPILER=="GCC"):
  1623. if GetTarget() == 'darwin':
  1624. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1625. else:
  1626. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1627. for x in obj:
  1628. if GetLinkAllStatic() and x.endswith('.a'):
  1629. continue
  1630. cmd += ' ' + BracketNameWithQuotes(x)
  1631. oscmd(cmd)
  1632. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1633. ########################################################################
  1634. ##
  1635. ## CompileLink
  1636. ##
  1637. ########################################################################
  1638. def CompileLink(dll, obj, opts):
  1639. if (COMPILER=="MSVC"):
  1640. if not BOOUSEINTELCOMPILER:
  1641. cmd = "link /nologo "
  1642. if HasTargetArch():
  1643. cmd += " /MACHINE:" + GetTargetArch().upper()
  1644. if ("MFC" not in opts):
  1645. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1646. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1647. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1648. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1649. optlevel = GetOptimizeOption(opts)
  1650. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1651. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1652. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1653. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1654. if ("MFC" in opts):
  1655. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1656. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1657. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1658. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1659. if not PkgSkip("PYTHON"):
  1660. # If we're building without Python, don't pick it up implicitly.
  1661. if "PYTHON" not in opts:
  1662. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1663. if optlevel <= 2:
  1664. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1665. else:
  1666. cmd += ' /NOD:{}.lib'.format(pythonv)
  1667. # Yes, we know we are importing "locally defined symbols".
  1668. for x in obj:
  1669. if x.endswith('libp3pystub.lib'):
  1670. cmd += ' /ignore:4049,4217'
  1671. break
  1672. # Set the subsystem. Specify that we want to target Windows XP.
  1673. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1674. cmd += " /SUBSYSTEM:" + subsystem
  1675. if GetTargetArch() == 'x64':
  1676. cmd += ",5.02"
  1677. else:
  1678. cmd += ",5.01"
  1679. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1680. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1681. for (opt, dir) in LIBDIRECTORIES:
  1682. if (opt=="ALWAYS") or (opt in opts):
  1683. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1684. for x in obj:
  1685. if x.endswith(".dll") or x.endswith(".pyd"):
  1686. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1687. elif x.endswith(".lib"):
  1688. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1689. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1690. exit("Error: in makepanda, specify "+dname+", not "+x)
  1691. cmd += ' ' + BracketNameWithQuotes(x)
  1692. elif x.endswith(".def"):
  1693. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1694. elif x.endswith(".dat"):
  1695. pass
  1696. else:
  1697. cmd += ' ' + BracketNameWithQuotes(x)
  1698. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1699. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1700. for (opt, name) in LIBNAMES:
  1701. if (opt=="ALWAYS") or (opt in opts):
  1702. cmd += " " + BracketNameWithQuotes(name)
  1703. oscmd(cmd)
  1704. else:
  1705. cmd = "xilink"
  1706. if GetVerbose(): cmd += " /verbose:lib"
  1707. if HasTargetArch():
  1708. cmd += " /MACHINE:" + GetTargetArch().upper()
  1709. if ("MFC" not in opts):
  1710. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1711. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1712. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1713. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1714. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1715. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1716. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1717. optlevel = GetOptimizeOption(opts)
  1718. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1719. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1720. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1721. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1722. if ("MFC" in opts):
  1723. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1724. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1725. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1726. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1727. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1728. if subsystem:
  1729. cmd += " /SUBSYSTEM:" + subsystem
  1730. if dll.endswith(".dll"):
  1731. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1732. for (opt, dir) in LIBDIRECTORIES:
  1733. if (opt=="ALWAYS") or (opt in opts):
  1734. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1735. for x in obj:
  1736. if x.endswith(".dll") or x.endswith(".pyd"):
  1737. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1738. elif x.endswith(".lib"):
  1739. dname = os.path.splitext(dll)[0]+".dll"
  1740. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1741. exit("Error: in makepanda, specify "+dname+", not "+x)
  1742. cmd += ' ' + BracketNameWithQuotes(x)
  1743. elif x.endswith(".def"):
  1744. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1745. elif x.endswith(".dat"):
  1746. pass
  1747. else:
  1748. cmd += ' ' + BracketNameWithQuotes(x)
  1749. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1750. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1751. for (opt, name) in LIBNAMES:
  1752. if (opt=="ALWAYS") or (opt in opts):
  1753. cmd += " " + BracketNameWithQuotes(name)
  1754. oscmd(cmd)
  1755. if COMPILER == "GCC":
  1756. cxx = GetCXX()
  1757. if GetOrigExt(dll) == ".exe":
  1758. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1759. if GetTarget() == "android":
  1760. # Necessary to work around an issue with libandroid depending on vendor libraries
  1761. cmd += ' -Wl,--allow-shlib-undefined'
  1762. else:
  1763. if (GetTarget() == "darwin"):
  1764. cmd = cxx + ' -undefined dynamic_lookup'
  1765. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1766. cmd += ' -bundle '
  1767. else:
  1768. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1769. cmd += ' -dynamiclib -install_name ' + install_name
  1770. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1771. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1772. else:
  1773. cmd = cxx + ' -shared'
  1774. # Always set soname on Android to avoid a linker warning when loading the library.
  1775. if "MODULE" not in opts or GetTarget() == 'android':
  1776. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1777. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1778. for x in obj:
  1779. if GetOrigExt(x) != ".dat":
  1780. cmd += ' ' + x
  1781. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1782. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1783. # macOS specific flags.
  1784. if GetTarget() == 'darwin':
  1785. cmd += " -headerpad_max_install_names"
  1786. if OSXTARGET is not None:
  1787. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1788. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1789. elif platform.mac_ver()[0].startswith('11.'):
  1790. cmd += " -mmacosx-version-min=11.0"
  1791. for arch in OSX_ARCHS:
  1792. if 'NOARCH:' + arch.upper() not in opts:
  1793. cmd += " -arch %s" % arch
  1794. elif GetTarget() == 'android':
  1795. arch = GetTargetArch()
  1796. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1797. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1798. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1799. if arch == 'armv7a':
  1800. cmd += ' -target armv7-none-linux-androideabi'
  1801. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1802. elif arch == 'arm':
  1803. cmd += ' -target armv5te-none-linux-androideabi'
  1804. elif arch == 'aarch64':
  1805. cmd += ' -target aarch64-none-linux-android'
  1806. elif arch == 'mips':
  1807. cmd += ' -target mipsel-none-linux-android'
  1808. cmd += ' -mips32'
  1809. elif arch == 'mips64':
  1810. cmd += ' -target mips64el-none-linux-android'
  1811. elif arch == 'x86':
  1812. cmd += ' -target i686-none-linux-android'
  1813. elif arch == 'x86_64':
  1814. cmd += ' -target x86_64-none-linux-android'
  1815. cmd += ' -lc -lm'
  1816. else:
  1817. cmd += " -pthread"
  1818. if "SYSROOT" in SDK:
  1819. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1820. if LDFLAGS != "":
  1821. cmd += " " + LDFLAGS
  1822. # Don't link libraries with Python, except on Android.
  1823. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1824. opts = opts[:]
  1825. opts.remove("PYTHON")
  1826. for (opt, dir) in LIBDIRECTORIES:
  1827. if (opt=="ALWAYS") or (opt in opts):
  1828. cmd += ' -L' + BracketNameWithQuotes(dir)
  1829. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1830. if (opt=="ALWAYS") or (opt in opts):
  1831. cmd += ' -F' + BracketNameWithQuotes(dir)
  1832. for (opt, name) in LIBNAMES:
  1833. if (opt=="ALWAYS") or (opt in opts):
  1834. cmd += ' ' + BracketNameWithQuotes(name)
  1835. if GetTarget() != 'freebsd':
  1836. cmd += " -ldl"
  1837. oscmd(cmd)
  1838. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1839. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1840. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1841. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1842. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1843. if os.path.isfile(newdll):
  1844. os.remove(newdll)
  1845. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1846. elif dll.endswith("." + MAJOR_VERSION):
  1847. newdll = dll[:-len(MAJOR_VERSION)-1]
  1848. if os.path.isfile(newdll):
  1849. os.remove(newdll)
  1850. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1851. ##########################################################################################
  1852. #
  1853. # CompileEgg
  1854. #
  1855. ##########################################################################################
  1856. def CompileEgg(eggfile, src, opts):
  1857. pz = False
  1858. if eggfile.endswith(".pz"):
  1859. pz = True
  1860. eggfile = eggfile[:-3]
  1861. # Determine the location of the pzip and flt2egg tools.
  1862. if CrossCompiling():
  1863. # We may not be able to use our generated versions of these tools,
  1864. # so we'll expect them to already be present in the PATH.
  1865. pzip = 'pzip'
  1866. flt2egg = 'flt2egg'
  1867. else:
  1868. # If we're compiling for this machine, we can use the binaries we've built.
  1869. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1870. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1871. if not os.path.isfile(pzip):
  1872. pzip = 'pzip'
  1873. if not os.path.isfile(flt2egg):
  1874. flt2egg = 'flt2egg'
  1875. if src.endswith(".egg"):
  1876. CopyFile(eggfile, src)
  1877. elif src.endswith(".flt"):
  1878. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1879. if pz:
  1880. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1881. ##########################################################################################
  1882. #
  1883. # CompileRes, CompileRsrc
  1884. #
  1885. ##########################################################################################
  1886. def CompileRes(target, src, opts):
  1887. """Compiles a Windows .rc file into a .res file."""
  1888. ipath = GetListOption(opts, "DIR:")
  1889. if (COMPILER == "MSVC"):
  1890. cmd = "rc"
  1891. cmd += " /Fo" + BracketNameWithQuotes(target)
  1892. for x in ipath: cmd += " /I" + x
  1893. for (opt,dir) in INCDIRECTORIES:
  1894. if (opt=="ALWAYS") or (opt in opts):
  1895. cmd += " /I" + BracketNameWithQuotes(dir)
  1896. for (opt,var,val) in DEFSYMBOLS:
  1897. if (opt=="ALWAYS") or (opt in opts):
  1898. cmd += " /D" + var + "=" + val
  1899. cmd += " " + BracketNameWithQuotes(src)
  1900. else:
  1901. cmd = "windres"
  1902. for x in ipath: cmd += " -I" + x
  1903. for (opt,dir) in INCDIRECTORIES:
  1904. if (opt=="ALWAYS") or (opt in opts):
  1905. cmd += " -I" + BracketNameWithQuotes(dir)
  1906. for (opt,var,val) in DEFSYMBOLS:
  1907. if (opt=="ALWAYS") or (opt in opts):
  1908. cmd += " -D" + var + "=" + val
  1909. cmd += " -i " + BracketNameWithQuotes(src)
  1910. cmd += " -o " + BracketNameWithQuotes(target)
  1911. oscmd(cmd)
  1912. def CompileRsrc(target, src, opts):
  1913. """Compiles a Mac OS .r file into an .rsrc file."""
  1914. ipath = GetListOption(opts, "DIR:")
  1915. if os.path.isfile("/usr/bin/Rez"):
  1916. cmd = "Rez -useDF"
  1917. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1918. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1919. else:
  1920. cmd = "/Developer/Tools/Rez -useDF"
  1921. cmd += " -o " + BracketNameWithQuotes(target)
  1922. for x in ipath:
  1923. cmd += " -i " + x
  1924. for (opt,dir) in INCDIRECTORIES:
  1925. if (opt=="ALWAYS") or (opt in opts):
  1926. cmd += " -i " + BracketNameWithQuotes(dir)
  1927. for (opt,var,val) in DEFSYMBOLS:
  1928. if (opt=="ALWAYS") or (opt in opts):
  1929. if (val == ""):
  1930. cmd += " -d " + var
  1931. else:
  1932. cmd += " -d " + var + " = " + val
  1933. cmd += " " + BracketNameWithQuotes(src)
  1934. oscmd(cmd)
  1935. ##########################################################################################
  1936. #
  1937. # CompileJava (Android only)
  1938. #
  1939. ##########################################################################################
  1940. def CompileJava(target, src, opts):
  1941. """Compiles a .java file into a .class file."""
  1942. if GetHost() == 'android':
  1943. cmd = "ecj "
  1944. else:
  1945. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1946. optlevel = GetOptimizeOption(opts)
  1947. if optlevel >= 4:
  1948. cmd += "-debug:none "
  1949. cmd += "-cp " + GetOutputDir() + "/classes "
  1950. cmd += "-d " + GetOutputDir() + "/classes "
  1951. cmd += BracketNameWithQuotes(src)
  1952. oscmd(cmd)
  1953. ##########################################################################################
  1954. #
  1955. # FreezePy
  1956. #
  1957. ##########################################################################################
  1958. def FreezePy(target, inputs, opts):
  1959. assert len(inputs) > 0
  1960. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1961. if sys.version_info >= (2, 6):
  1962. cmdstr += "-B "
  1963. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1964. if 'FREEZE_STARTUP' in opts:
  1965. cmdstr += " -s"
  1966. if GetOrigExt(target) == '.exe':
  1967. src = inputs.pop(0)
  1968. else:
  1969. src = ""
  1970. for i in inputs:
  1971. i = os.path.splitext(i)[0]
  1972. i = i.replace('/', '.')
  1973. if i.startswith('direct.src'):
  1974. i = i.replace('.src.', '.')
  1975. cmdstr += " -i " + i
  1976. cmdstr += " -o " + target + " " + src
  1977. if ("LINK_PYTHON_STATIC" in opts):
  1978. os.environ["LINK_PYTHON_STATIC"] = "1"
  1979. oscmd(cmdstr)
  1980. if ("LINK_PYTHON_STATIC" in os.environ):
  1981. del os.environ["LINK_PYTHON_STATIC"]
  1982. if (not os.path.exists(target)):
  1983. exit("FREEZER_ERROR")
  1984. ##########################################################################################
  1985. #
  1986. # Package
  1987. #
  1988. ##########################################################################################
  1989. def Package(target, inputs, opts):
  1990. assert len(inputs) == 1
  1991. # Invoke the ppackage script.
  1992. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1993. if GetOptimizeOption(opts) >= 4:
  1994. command += "-OO "
  1995. if sys.version_info >= (2, 6):
  1996. command += "-B "
  1997. command += "direct/src/p3d/ppackage.py"
  1998. if not RTDIST:
  1999. # Don't compile Python sources, because we might not running in the same
  2000. # Python version as the selected host.
  2001. command += " -N"
  2002. if GetTarget() == "darwin":
  2003. if SDK.get("MACOSX"):
  2004. command += " -R \"%s\"" % SDK["MACOSX"]
  2005. for arch in OSX_ARCHS:
  2006. if arch == "x86_64":
  2007. arch = "amd64"
  2008. command += " -P osx_%s" % arch
  2009. command += " -i \"" + GetOutputDir() + "/stage\""
  2010. if (P3DSUFFIX):
  2011. command += ' -a "' + P3DSUFFIX + '"'
  2012. command += " " + inputs[0]
  2013. if GetOrigExt(target) == '.p3d':
  2014. # Build a specific .p3d file.
  2015. basename = os.path.basename(os.path.splitext(target)[0])
  2016. command += " " + basename
  2017. oscmd(command)
  2018. if GetTarget() == 'windows':
  2019. # Make an .exe that calls this .p3d.
  2020. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2021. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2022. exefile = FindLocation(basename + '.exe', [])
  2023. CompileLink(exefile, [objfile], ['ADVAPI'])
  2024. # Move it to the bin directory.
  2025. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2026. if sys.platform != 'win32':
  2027. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2028. else:
  2029. # This is presumably a package or set of packages.
  2030. oscmd(command)
  2031. ##########################################################################################
  2032. #
  2033. # CompileBundle
  2034. #
  2035. ##########################################################################################
  2036. def CompileBundle(target, inputs, opts):
  2037. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2038. plist = None
  2039. resources = []
  2040. objects = []
  2041. for i in inputs:
  2042. if (i.endswith(".plist")):
  2043. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2044. plist = i
  2045. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2046. resources.append(i)
  2047. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2048. objects.append(i)
  2049. else:
  2050. exit("Don't know how to bundle file %s" % i)
  2051. # Now link the object files to form the bundle.
  2052. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2053. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2054. oscmd("rm -rf %s" % target)
  2055. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2056. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2057. if target.endswith(".app"):
  2058. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2059. else:
  2060. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2061. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2062. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2063. for r in resources:
  2064. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2065. ##########################################################################################
  2066. #
  2067. # CompileMIDL
  2068. #
  2069. ##########################################################################################
  2070. def CompileMIDL(target, src, opts):
  2071. ipath = GetListOption(opts, "DIR:")
  2072. if (COMPILER=="MSVC"):
  2073. cmd = "midl"
  2074. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2075. for x in ipath: cmd += " /I" + x
  2076. for (opt,dir) in INCDIRECTORIES:
  2077. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2078. for (opt,var,val) in DEFSYMBOLS:
  2079. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2080. cmd += " " + BracketNameWithQuotes(src)
  2081. oscmd(cmd)
  2082. ##########################################################################################
  2083. #
  2084. # CompileAnything
  2085. #
  2086. ##########################################################################################
  2087. def CompileAnything(target, inputs, opts, progress = None):
  2088. if (opts.count("DEPENDENCYONLY")):
  2089. return
  2090. if (len(inputs)==0):
  2091. exit("No input files for target "+target)
  2092. infile = inputs[0]
  2093. origsuffix = GetOrigExt(target)
  2094. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2095. # It must be a simple copy operation.
  2096. ProgressOutput(progress, "Copying file", target)
  2097. CopyFile(target, infile)
  2098. if (origsuffix==".exe" and GetHost() != "windows"):
  2099. os.system("chmod +x \"%s\"" % target)
  2100. return
  2101. elif (infile.endswith(".py")):
  2102. if origsuffix == ".obj":
  2103. source = os.path.splitext(target)[0] + ".c"
  2104. SetOrigExt(source, ".c")
  2105. ProgressOutput(progress, "Building frozen source", source)
  2106. FreezePy(source, inputs, opts)
  2107. ProgressOutput(progress, "Building C++ object", target)
  2108. return CompileCxx(target, source, opts)
  2109. if origsuffix == ".exe":
  2110. ProgressOutput(progress, "Building frozen executable", target)
  2111. else:
  2112. ProgressOutput(progress, "Building frozen library", target)
  2113. return FreezePy(target, inputs, opts)
  2114. elif (infile.endswith(".idl")):
  2115. ProgressOutput(progress, "Compiling MIDL file", infile)
  2116. return CompileMIDL(target, infile, opts)
  2117. elif (infile.endswith(".pdef")):
  2118. if origsuffix == '.p3d':
  2119. ProgressOutput(progress, "Building package", target)
  2120. else:
  2121. ProgressOutput(progress, "Building package from pdef file", infile)
  2122. return Package(target, inputs, opts)
  2123. elif origsuffix in SUFFIX_LIB:
  2124. ProgressOutput(progress, "Linking static library", target)
  2125. return CompileLib(target, inputs, opts)
  2126. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2127. if (origsuffix==".exe"):
  2128. ProgressOutput(progress, "Linking executable", target)
  2129. else:
  2130. ProgressOutput(progress, "Linking dynamic library", target)
  2131. # Add version number to the dynamic library, on unix
  2132. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2133. tplatform = GetTarget()
  2134. if tplatform == "darwin":
  2135. # On Mac, libraries are named like libpanda.1.2.dylib
  2136. if target.lower().endswith(".dylib"):
  2137. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2138. SetOrigExt(target, origsuffix)
  2139. elif tplatform != "windows" and tplatform != "android":
  2140. # On Linux, libraries are named like libpanda.so.1.2
  2141. target += "." + MAJOR_VERSION
  2142. SetOrigExt(target, origsuffix)
  2143. return CompileLink(target, inputs, opts)
  2144. elif (origsuffix==".in"):
  2145. ProgressOutput(progress, "Building Interrogate database", target)
  2146. return CompileIgate(target, inputs, opts)
  2147. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2148. ProgressOutput(progress, "Building plugin bundle", target)
  2149. return CompileBundle(target, inputs, opts)
  2150. elif (origsuffix==".app"):
  2151. ProgressOutput(progress, "Building application bundle", target)
  2152. return CompileBundle(target, inputs, opts)
  2153. elif (origsuffix==".pz"):
  2154. ProgressOutput(progress, "Compressing", target)
  2155. return CompileEgg(target, infile, opts)
  2156. elif (origsuffix==".egg"):
  2157. ProgressOutput(progress, "Converting", target)
  2158. return CompileEgg(target, infile, opts)
  2159. elif (origsuffix==".res"):
  2160. ProgressOutput(progress, "Building resource object", target)
  2161. return CompileRes(target, infile, opts)
  2162. elif (origsuffix==".rsrc"):
  2163. ProgressOutput(progress, "Building resource object", target)
  2164. return CompileRsrc(target, infile, opts)
  2165. elif (origsuffix==".class"):
  2166. ProgressOutput(progress, "Building Java class", target)
  2167. return CompileJava(target, infile, opts)
  2168. elif (origsuffix==".obj"):
  2169. if (infile.endswith(".cxx")):
  2170. ProgressOutput(progress, "Building C++ object", target)
  2171. return CompileCxx(target, infile, opts)
  2172. elif (infile.endswith(".c")):
  2173. ProgressOutput(progress, "Building C object", target)
  2174. return CompileCxx(target, infile, opts)
  2175. elif (infile.endswith(".mm")):
  2176. ProgressOutput(progress, "Building Objective-C++ object", target)
  2177. return CompileCxx(target, infile, opts)
  2178. elif (infile.endswith(".yxx")):
  2179. ProgressOutput(progress, "Building Bison object", target)
  2180. return CompileBison(target, infile, opts)
  2181. elif (infile.endswith(".lxx")):
  2182. ProgressOutput(progress, "Building Flex object", target)
  2183. return CompileFlex(target, infile, opts)
  2184. elif (infile.endswith(".in")):
  2185. ProgressOutput(progress, "Building Interrogate object", target)
  2186. return CompileImod(target, inputs, opts)
  2187. elif (infile.endswith(".rc")):
  2188. ProgressOutput(progress, "Building resource object", target)
  2189. return CompileRes(target, infile, opts)
  2190. elif (infile.endswith(".r")):
  2191. ProgressOutput(progress, "Building resource object", target)
  2192. return CompileRsrc(target, infile, opts)
  2193. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2194. ##########################################################################################
  2195. #
  2196. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2197. #
  2198. ##########################################################################################
  2199. DTOOL_CONFIG=[
  2200. #_Variable_________________________Windows___________________Unix__________
  2201. ("HAVE_PYTHON", '1', '1'),
  2202. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2203. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2204. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2205. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2206. ("HAVE_MAYA", '1', '1'),
  2207. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2208. ("USE_PANDAFILESTREAM", '1', '1'),
  2209. ("USE_DELETED_CHAIN", '1', '1'),
  2210. ("HAVE_WGL", '1', 'UNDEF'),
  2211. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2212. ("HAVE_THREADS", '1', '1'),
  2213. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2214. ("OS_SIMPLE_THREADS", '1', '1'),
  2215. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2216. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2217. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2218. ("HAVE_AUDIO", '1', '1'),
  2219. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2220. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2221. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2222. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2223. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2224. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2225. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2226. ("DO_PIPELINING", '1', '1'),
  2227. ("DEFAULT_PATHSEP", '";"', '":"'),
  2228. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2229. ("PHAVE_LOCKF", '1', '1'),
  2230. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2231. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2232. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2233. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2234. ("HAVE_GETOPT", 'UNDEF', '1'),
  2235. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2236. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2237. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2238. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2239. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2240. ("HAVE_IOS_BINARY", '1', '1'),
  2241. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2242. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2243. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2244. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2245. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2246. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2247. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2248. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2249. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2250. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2251. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2252. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2253. ("PHAVE_IO_H", '1', 'UNDEF'),
  2254. ("PHAVE_IOSTREAM", '1', '1'),
  2255. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2256. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2257. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2258. ("PHAVE_MALLOC_H", '1', '1'),
  2259. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2260. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2261. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2262. ("PHAVE_SSTREAM", '1', '1'),
  2263. ("PHAVE_NEW", '1', '1'),
  2264. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2265. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2266. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2267. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2268. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2269. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2270. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2271. ("PHAVE_STDINT_H", '1', '1'),
  2272. ("HAVE_RTTI", '1', '1'),
  2273. ("HAVE_X11", 'UNDEF', '1'),
  2274. ("IS_LINUX", 'UNDEF', '1'),
  2275. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2276. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2277. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2278. ("LINMATH_ALIGN", '1', '1'),
  2279. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2280. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2281. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2282. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2283. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2284. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2285. ("HAVE_SGI_RGB", '1', '1'),
  2286. ("HAVE_TGA", '1', '1'),
  2287. ("HAVE_IMG", '1', '1'),
  2288. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2289. ("HAVE_BMP", '1', '1'),
  2290. ("HAVE_PNM", '1', '1'),
  2291. ("HAVE_STB_IMAGE", '1', '1'),
  2292. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2293. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2294. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2295. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2296. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2297. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2298. ("WANT_NATIVE_NET", '1', '1'),
  2299. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2300. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2301. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2302. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2303. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2304. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2305. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2306. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2307. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2308. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2309. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2310. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2311. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2312. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2313. # ("_SECURE_SCL", '0', 'UNDEF'),
  2314. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2315. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2316. ]
  2317. PRC_PARAMETERS=[
  2318. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2319. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2320. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2321. ("PRC_PATH2_ENVVARS", '""', '""'),
  2322. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2323. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2324. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2325. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2326. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2327. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2328. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2329. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2330. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2331. ]
  2332. def WriteConfigSettings():
  2333. dtool_config={}
  2334. prc_parameters={}
  2335. speedtree_parameters={}
  2336. plugin_config={}
  2337. if (GetTarget() == 'windows'):
  2338. for key,win,unix in DTOOL_CONFIG:
  2339. dtool_config[key] = win
  2340. for key,win,unix in PRC_PARAMETERS:
  2341. prc_parameters[key] = win
  2342. else:
  2343. for key,win,unix in DTOOL_CONFIG:
  2344. dtool_config[key] = unix
  2345. for key,win,unix in PRC_PARAMETERS:
  2346. prc_parameters[key] = unix
  2347. for x in PkgListGet():
  2348. if ("HAVE_"+x in dtool_config):
  2349. if (PkgSkip(x)==0):
  2350. dtool_config["HAVE_"+x] = '1'
  2351. else:
  2352. dtool_config["HAVE_"+x] = 'UNDEF'
  2353. dtool_config["HAVE_NET"] = '1'
  2354. if (PkgSkip("NVIDIACG")==0):
  2355. dtool_config["HAVE_CG"] = '1'
  2356. dtool_config["HAVE_CGGL"] = '1'
  2357. dtool_config["HAVE_CGDX9"] = '1'
  2358. if GetTarget() not in ("linux", "android"):
  2359. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2360. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2361. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2362. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2363. if (GetTarget() == "darwin"):
  2364. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2365. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2366. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2367. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2368. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2369. dtool_config["IS_LINUX"] = 'UNDEF'
  2370. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2371. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2372. dtool_config["IS_OSX"] = '1'
  2373. if (GetTarget() == "freebsd"):
  2374. dtool_config["IS_LINUX"] = 'UNDEF'
  2375. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2376. dtool_config["IS_FREEBSD"] = '1'
  2377. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2378. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2379. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2380. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2381. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2382. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2383. if (GetTarget() == "android"):
  2384. # Android does have RTTI, but we disable it anyway.
  2385. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2386. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2387. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2388. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2389. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2390. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2391. # This should probably be more sophisticated, such as based
  2392. # on whether the libRocket Python modules are available.
  2393. if (PkgSkip("PYTHON") != 0):
  2394. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2395. if (GetOptimize() <= 3):
  2396. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2397. if (GetOptimize() <= 3):
  2398. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2399. dtool_config["DO_PSTATS"] = '1'
  2400. if (GetOptimize() <= 3):
  2401. dtool_config["DO_DCAST"] = '1'
  2402. if (GetOptimize() <= 3):
  2403. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2404. if (GetOptimize() <= 3):
  2405. dtool_config["DO_MEMORY_USAGE"] = '1'
  2406. if (GetOptimize() <= 3):
  2407. dtool_config["NOTIFY_DEBUG"] = '1'
  2408. if (GetOptimize() >= 4):
  2409. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2410. if (GetOptimize() >= 4):
  2411. # Disable RTTI on release builds.
  2412. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2413. # Now that we have OS_SIMPLE_THREADS, we can support
  2414. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2415. # longer need to disable it for this platform.
  2416. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2417. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2418. if (RTDIST or RUNTIME):
  2419. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2420. if HOST_URL:
  2421. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2422. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2423. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2424. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2425. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2426. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2427. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2428. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2429. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2430. if PkgSkip("GTK2") == 0:
  2431. plugin_config["HAVE_GTK"] = '1'
  2432. if (RUNTIME):
  2433. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2434. # Whether it's present on the system doesn't matter here,
  2435. # as the runtime itself doesn't include or link with X11.
  2436. if (RUNTIME and GetTarget() == 'linux'):
  2437. dtool_config["HAVE_X11"] = '1'
  2438. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2439. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2440. else:
  2441. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2442. if (PkgSkip("SPEEDTREE")==0):
  2443. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2444. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2445. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2446. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2447. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2448. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2449. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2450. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2451. for key in sorted(prc_parameters.keys()):
  2452. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2453. val = OverrideValue(key, prc_parameters[key])
  2454. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2455. else: conf = conf + "#define " + key + " " + val + "\n"
  2456. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2457. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2458. for key in sorted(dtool_config.keys()):
  2459. val = OverrideValue(key, dtool_config[key])
  2460. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2461. # These are not available for ARM, period.
  2462. conf = conf + "#ifdef __aarch64__\n"
  2463. conf = conf + "#undef " + key + "\n"
  2464. conf = conf + "#else\n"
  2465. conf = conf + "#define " + key + " " + val + "\n"
  2466. conf = conf + "#endif\n"
  2467. elif val == 'UNDEF':
  2468. conf = conf + "#undef " + key + "\n"
  2469. else:
  2470. conf = conf + "#define " + key + " " + val + "\n"
  2471. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2472. if (RTDIST or RUNTIME):
  2473. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2474. for key in sorted(plugin_config.keys()):
  2475. val = plugin_config[key]
  2476. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2477. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2478. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2479. if (PkgSkip("SPEEDTREE")==0):
  2480. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2481. for key in sorted(speedtree_parameters.keys()):
  2482. val = OverrideValue(key, speedtree_parameters[key])
  2483. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2484. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2485. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2486. for x in PkgListGet():
  2487. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2488. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2489. # Finally, write a platform.dat with the platform we are compiling for.
  2490. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2491. # This is useful for tools like makepackage that need to know things about
  2492. # the build parameters.
  2493. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2494. WriteConfigSettings()
  2495. WarnConflictingFiles()
  2496. if SystemLibraryExists("dtoolbase"):
  2497. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2498. if SystemLibraryExists("p3dtoolconfig"):
  2499. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2500. ##########################################################################################
  2501. #
  2502. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2503. #
  2504. ##########################################################################################
  2505. PANDAVERSION_H="""
  2506. #define PANDA_MAJOR_VERSION $VERSION1
  2507. #define PANDA_MINOR_VERSION $VERSION2
  2508. #define PANDA_SEQUENCE_VERSION $VERSION3
  2509. #define PANDA_VERSION $NVERSION
  2510. #define PANDA_NUMERIC_VERSION $NVERSION
  2511. #define PANDA_VERSION_STR "$VERSION"
  2512. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2513. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2514. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2515. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2516. """
  2517. PANDAVERSION_H_RUNTIME="""
  2518. #define PANDA_MAJOR_VERSION 0
  2519. #define PANDA_MINOR_VERSION 0
  2520. #define PANDA_SEQUENCE_VERSION 0
  2521. #define PANDA_VERSION_STR "0.0.0"
  2522. #define PANDA_ABI_VERSION_STR "0.0"
  2523. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2524. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2525. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2526. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2527. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2528. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2529. #define PANDA_PACKAGE_VERSION_STR ""
  2530. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2531. """
  2532. CHECKPANDAVERSION_CXX="""
  2533. # include "dtoolbase.h"
  2534. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2535. """
  2536. CHECKPANDAVERSION_H="""
  2537. # ifndef CHECKPANDAVERSION_H
  2538. # define CHECKPANDAVERSION_H
  2539. # include "dtoolbase.h"
  2540. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2541. // Hack to forcibly depend on the check
  2542. template<typename T>
  2543. class CheckPandaVersion {
  2544. public:
  2545. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2546. };
  2547. template class CheckPandaVersion<void>;
  2548. # endif
  2549. """
  2550. P3DACTIVEX_RC="""#include "resource.h"
  2551. #define APSTUDIO_READONLY_SYMBOLS
  2552. #include "afxres.h"
  2553. #undef APSTUDIO_READONLY_SYMBOLS
  2554. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2555. #ifdef _WIN32
  2556. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2557. #pragma code_page(1252)
  2558. #endif
  2559. #ifdef APSTUDIO_INVOKED
  2560. 1 TEXTINCLUDE
  2561. BEGIN
  2562. "resource.h\\0"
  2563. END
  2564. 2 TEXTINCLUDE
  2565. BEGIN
  2566. "#include ""afxres.h""\\r\\n"
  2567. "\\0"
  2568. END
  2569. 3 TEXTINCLUDE
  2570. BEGIN
  2571. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2572. "\\0"
  2573. END
  2574. #endif
  2575. %s
  2576. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2577. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2578. STYLE DS_SETFONT | WS_CHILD
  2579. FONT 8, "MS Sans Serif"
  2580. BEGIN
  2581. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2582. IDC_STATIC,7,25,229,16
  2583. END
  2584. #ifdef APSTUDIO_INVOKED
  2585. GUIDELINES DESIGNINFO
  2586. BEGIN
  2587. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2588. BEGIN
  2589. LEFTMARGIN, 7
  2590. RIGHTMARGIN, 243
  2591. TOPMARGIN, 7
  2592. BOTTOMMARGIN, 55
  2593. END
  2594. END
  2595. #endif
  2596. STRINGTABLE
  2597. BEGIN
  2598. IDS_P3DACTIVEX "P3DActiveX Control"
  2599. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2600. END
  2601. STRINGTABLE
  2602. BEGIN
  2603. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2604. END
  2605. #endif
  2606. #ifndef APSTUDIO_INVOKED
  2607. 1 TYPELIB "P3DActiveX.tlb"
  2608. #endif"""
  2609. def CreatePandaVersionFiles():
  2610. version1=int(VERSION.split(".")[0])
  2611. version2=int(VERSION.split(".")[1])
  2612. version3=int(VERSION.split(".")[2])
  2613. nversion=version1*1000000+version2*1000+version3
  2614. if (DISTRIBUTOR != "cmu"):
  2615. # Subtract 1 if we are not an official version.
  2616. nversion -= 1
  2617. if (RUNTIME):
  2618. pandaversion_h = PANDAVERSION_H_RUNTIME
  2619. else:
  2620. pandaversion_h = PANDAVERSION_H
  2621. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2622. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2623. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2624. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2625. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2626. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2627. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2628. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2629. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2630. if (DISTRIBUTOR == "cmu"):
  2631. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2632. else:
  2633. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2634. if GIT_COMMIT:
  2635. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2636. # Allow creating a deterministic build by setting this.
  2637. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2638. if source_date:
  2639. # This matches the GCC / Clang format for __DATE__ __TIME__
  2640. source_date = time.gmtime(int(source_date))
  2641. try:
  2642. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2643. except ValueError:
  2644. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2645. if source_date[3:5] == ' 0':
  2646. source_date = source_date[:3] + ' ' + source_date[5:]
  2647. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2648. if not RUNTIME:
  2649. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2650. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2651. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2652. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2653. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2654. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2655. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2656. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2657. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2658. if RUNTIME:
  2659. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2660. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2661. else:
  2662. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2663. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2664. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2665. if RUNTIME:
  2666. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2667. "version" : VERSION,
  2668. "description" : "Runs 3-D games and interactive applets",
  2669. "filename" : "p3dactivex.ocx",
  2670. "mimetype" : "application/x-panda3d",
  2671. "extension" : "p3d",
  2672. "filedesc" : "Panda3D applet"}
  2673. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2674. CreatePandaVersionFiles()
  2675. ##########################################################################################
  2676. #
  2677. # Copy the "direct" tree
  2678. #
  2679. ##########################################################################################
  2680. if (PkgSkip("DIRECT")==0):
  2681. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2682. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2683. # This file used to be copied, but would nowadays cause conflicts.
  2684. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2685. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2686. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2687. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2688. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2689. # This directory doesn't exist at all any more.
  2690. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2691. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2692. # These files used to exist; remove them to avoid conflicts.
  2693. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2694. '_core.pyd', '_core.so',
  2695. 'direct.py', 'direct.pyc', 'direct.pyo',
  2696. '_direct.pyd', '_direct.so',
  2697. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2698. for basename in del_files:
  2699. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2700. if os.path.isfile(path):
  2701. print("Removing %s" % (path))
  2702. os.remove(path)
  2703. # Write an appropriate panda3d/__init__.py
  2704. p3d_init = """"Python bindings for the Panda3D libraries"
  2705. __version__ = '%s'
  2706. """ % (WHLVERSION)
  2707. if GetTarget() == 'windows':
  2708. p3d_init += """
  2709. if '__file__' in locals():
  2710. import os
  2711. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2712. if os.path.isdir(bindir):
  2713. if hasattr(os, 'add_dll_directory'):
  2714. os.add_dll_directory(bindir)
  2715. elif not os.environ.get('PATH'):
  2716. os.environ['PATH'] = bindir
  2717. else:
  2718. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2719. del os, bindir
  2720. """
  2721. if not PkgSkip("PYTHON"):
  2722. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2723. # Also add this file, for backward compatibility.
  2724. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2725. '''Alias of :mod:`panda3d.interrogatedb`.
  2726. .. deprecated:: 1.10.0
  2727. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2728. '''
  2729. if __debug__:
  2730. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2731. from .interrogatedb import *
  2732. """)
  2733. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2734. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2735. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2736. os.remove(fn)
  2737. panda_modules = ['core']
  2738. if not PkgSkip("PANDAPHYSICS"):
  2739. panda_modules.append('physics')
  2740. if not PkgSkip('PANDAFX'):
  2741. panda_modules.append('fx')
  2742. if not PkgSkip("DIRECT"):
  2743. panda_modules.append('direct')
  2744. if not PkgSkip("VISION"):
  2745. panda_modules.append('vision')
  2746. if not PkgSkip("SKEL"):
  2747. panda_modules.append('skel')
  2748. if not PkgSkip("EGG"):
  2749. panda_modules.append('egg')
  2750. if not PkgSkip("ODE"):
  2751. panda_modules.append('ode')
  2752. if not PkgSkip("VRPN"):
  2753. panda_modules.append('vrpn')
  2754. panda_modules_code = """
  2755. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2756. if __debug__:
  2757. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2758. """
  2759. for module in panda_modules:
  2760. panda_modules_code += """
  2761. try:
  2762. from panda3d.%s import *
  2763. except ImportError as err:
  2764. if "No module named %s" not in str(err):
  2765. raise""" % (module, module)
  2766. panda_modules_code += """
  2767. from direct.showbase import DConfig
  2768. def get_config_showbase():
  2769. return DConfig
  2770. def get_config_express():
  2771. return DConfig
  2772. getConfigShowbase = get_config_showbase
  2773. getConfigExpress = get_config_express
  2774. """
  2775. exthelpers_code = """
  2776. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2777. from direct.extensions_native.extension_native_helpers import *
  2778. """
  2779. if not PkgSkip("PYTHON"):
  2780. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2781. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2782. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2783. ##########################################################################################
  2784. #
  2785. # Write the dist-info directory.
  2786. #
  2787. ##########################################################################################
  2788. # This is just some basic stuff since setuptools just needs this file to
  2789. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2790. # eventually want to merge this with the metadata generator in makewheel.py.
  2791. METADATA = """Metadata-Version: 2.0
  2792. Name: Panda3D
  2793. Version: {version}
  2794. License: BSD
  2795. Home-page: https://www.panda3d.org/
  2796. Author: Panda3D Team
  2797. Author-email: [email protected]
  2798. """
  2799. ENTRY_POINTS = """[distutils.commands]
  2800. build_apps = direct.dist.commands:build_apps
  2801. bdist_apps = direct.dist.commands:bdist_apps
  2802. """
  2803. if not PkgSkip("DIRECT"):
  2804. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2805. MakeDirectory(dist_dir)
  2806. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2807. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2808. ##########################################################################################
  2809. #
  2810. # Generate the PRC files into the ETC directory.
  2811. #
  2812. ##########################################################################################
  2813. confautoprc = ReadFile("makepanda/confauto.in")
  2814. if (PkgSkip("SPEEDTREE")==0):
  2815. # If SpeedTree is available, enable it in the config file
  2816. confautoprc = confautoprc.replace('#st#', '')
  2817. else:
  2818. # otherwise, disable it.
  2819. confautoprc = confautoprc.replace('#st#', '#')
  2820. confautoprc = confautoprc.replace('\r\n', '\n')
  2821. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2822. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2823. if PkgSkip("EGG") or GetLinkAllStatic():
  2824. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2825. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2826. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2827. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2828. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2829. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2830. if (os.path.isfile("makepanda/myconfig.in")):
  2831. configprc = ReadFile("makepanda/myconfig.in")
  2832. else:
  2833. configprc = ReadFile("makepanda/config.in")
  2834. configprc = configprc.replace('\r\n', '\n')
  2835. if (GetTarget() == 'windows'):
  2836. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2837. else:
  2838. configprc = configprc.replace("aux-display pandadx9", "")
  2839. if (GetTarget() == 'darwin'):
  2840. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2841. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2842. if not PkgSkip("FMODEX"):
  2843. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2844. if PkgSkip("GL") or GetLinkAllStatic():
  2845. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2846. if PkgSkip("GLES") or GetLinkAllStatic():
  2847. configprc = configprc.replace("\n#load-display pandagles", "")
  2848. if PkgSkip("DX9") or GetLinkAllStatic():
  2849. configprc = configprc.replace("\n#load-display pandadx9", "")
  2850. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2851. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2852. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2853. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2854. if GetTarget() == 'windows':
  2855. # Convert to Windows newlines.
  2856. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2857. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2858. else:
  2859. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2860. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2861. ##########################################################################################
  2862. #
  2863. # Copy the precompiled binaries and DLLs into the build.
  2864. #
  2865. ##########################################################################################
  2866. tp_dir = GetThirdpartyDir()
  2867. if tp_dir is not None:
  2868. dylibs = {}
  2869. if GetTarget() == 'darwin':
  2870. # Make a list of all the dylibs we ship, to figure out whether we should use
  2871. # install_name_tool to correct the library reference to point to our copy.
  2872. for pkg in PkgListGet():
  2873. if PkgSkip(pkg):
  2874. continue
  2875. tp_libdir = GetThirdpartyLibDir(pkg)
  2876. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2877. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2878. if not PkgSkip("PYTHON"):
  2879. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2880. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2881. for pkg in PkgListGet():
  2882. if PkgSkip(pkg):
  2883. continue
  2884. tp_pkg = tp_dir + pkg.lower()
  2885. if GetTarget() == 'windows':
  2886. if os.path.exists(tp_pkg + "/bin"):
  2887. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2888. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2889. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2890. elif GetTarget() == 'darwin':
  2891. tp_libdir = GetThirdpartyLibDir(pkg)
  2892. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2893. if not PkgSkip("PYTHON"):
  2894. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2895. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2896. if pkg != 'PYTHON':
  2897. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2898. for tp_lib in tp_libs:
  2899. basename = os.path.basename(tp_lib)
  2900. if basename.endswith('.dylib'):
  2901. # It's a dynamic link library. Put it in the lib directory.
  2902. target = GetOutputDir() + "/lib/" + basename
  2903. dep_prefix = "@loader_path/../lib/"
  2904. lib_id = dep_prefix + basename
  2905. else:
  2906. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2907. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2908. target = GetOutputDir() + "/" + basename
  2909. dep_prefix = "@loader_path/lib/"
  2910. lib_id = basename
  2911. if not NeedsBuild([target], [tp_lib]):
  2912. continue
  2913. CopyFile(target, tp_lib)
  2914. if os.path.islink(target) or target.endswith('.py'):
  2915. continue
  2916. # Correct the inter-library dependencies so that the build is relocatable.
  2917. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2918. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2919. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2920. line = line.strip()
  2921. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2922. continue
  2923. libdep = line.split(" ", 1)[0]
  2924. dep_basename = os.path.basename(libdep)
  2925. if dep_basename in dylibs:
  2926. dep_target = dylibs[dep_basename]
  2927. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2928. JustBuilt([target], [tp_lib])
  2929. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2930. MakeDirectory(GetOutputDir() + "/Frameworks")
  2931. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2932. else: # Linux / FreeBSD case.
  2933. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2934. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2935. if not PkgSkip("PYTHON"):
  2936. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2937. base = os.path.basename(tp_lib)
  2938. if base.startswith('lib'):
  2939. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2940. else:
  2941. # It's a Python module, like _rocketcore.so.
  2942. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2943. if GetTarget() == 'windows':
  2944. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2945. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2946. if not PkgSkip("PYTHON") and not RTDIST:
  2947. # We need to copy the Python DLL to the bin directory for now.
  2948. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2949. if GetOptimize() <= 2:
  2950. pydll += "_d.dll"
  2951. else:
  2952. pydll += ".dll"
  2953. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2954. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2955. CopyFile(GetOutputDir() + "/bin/", fn)
  2956. # Copy the whole Python directory.
  2957. if COPY_PYTHON:
  2958. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2959. # NB: Python does not always ship with the correct manifest/dll.
  2960. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2961. manifest = GetOutputDir() + '/tmp/python.manifest'
  2962. if os.path.isfile(manifest):
  2963. os.unlink(manifest)
  2964. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2965. if COPY_PYTHON and os.path.isfile(manifest):
  2966. import xml.etree.ElementTree as ET
  2967. tree = ET.parse(manifest)
  2968. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2969. else:
  2970. idents = ()
  2971. for ident in idents:
  2972. sxs_name = '_'.join([
  2973. ident.get('processorArchitecture'),
  2974. ident.get('name').lower(),
  2975. ident.get('publicKeyToken'),
  2976. ident.get('version'),
  2977. ])
  2978. # Find the manifest matching these parameters.
  2979. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2980. manifests = glob.glob(pattern)
  2981. if not manifests:
  2982. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2983. continue
  2984. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2985. # Also copy the corresponding msvcr dll.
  2986. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2987. for file in glob.glob(pattern):
  2988. CopyFile(GetOutputDir() + "/python/", file)
  2989. # Copy python.exe to ppython.exe.
  2990. if COPY_PYTHON:
  2991. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2992. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2993. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2994. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2995. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2996. # Copy over the MSVC runtime.
  2997. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2998. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2999. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3000. if ("VCTOOLSVERSION" in SDK):
  3001. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3002. else:
  3003. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3004. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3005. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3006. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3007. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3008. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3009. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3010. ########################################################################
  3011. ##
  3012. ## Copy various stuff into the build.
  3013. ##
  3014. ########################################################################
  3015. if GetTarget() == 'windows':
  3016. # Convert to Windows newlines so they can be opened by notepad.
  3017. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3018. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3019. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3020. else:
  3021. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3022. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3023. if (PkgSkip("PANDATOOL")==0):
  3024. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3025. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3026. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3027. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3028. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3029. # Since Eigen is included by all sorts of core headers, as a convenience
  3030. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3031. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3032. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3033. ########################################################################
  3034. #
  3035. # Copy header files to the built/include/parser-inc directory.
  3036. #
  3037. ########################################################################
  3038. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3039. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3040. ########################################################################
  3041. #
  3042. # Transfer all header files to the built/include directory.
  3043. #
  3044. ########################################################################
  3045. CopyAllHeaders('dtool/src/dtoolbase')
  3046. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3047. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3048. CopyAllHeaders('dtool/metalibs/dtool')
  3049. CopyAllHeaders('dtool/src/cppparser')
  3050. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3051. CopyAllHeaders('dtool/src/dconfig')
  3052. CopyAllHeaders('dtool/src/interrogatedb')
  3053. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3054. CopyAllHeaders('dtool/src/pystub')
  3055. CopyAllHeaders('dtool/src/interrogate')
  3056. CopyAllHeaders('dtool/src/test_interrogate')
  3057. CopyAllHeaders('panda/src/putil')
  3058. CopyAllHeaders('panda/src/pandabase')
  3059. CopyAllHeaders('panda/src/express')
  3060. CopyAllHeaders('panda/src/downloader')
  3061. CopyAllHeaders('panda/metalibs/pandaexpress')
  3062. CopyAllHeaders('panda/src/pipeline')
  3063. CopyAllHeaders('panda/src/linmath')
  3064. CopyAllHeaders('panda/src/putil')
  3065. CopyAllHeaders('dtool/src/prckeys')
  3066. CopyAllHeaders('panda/src/audio')
  3067. CopyAllHeaders('panda/src/event')
  3068. CopyAllHeaders('panda/src/mathutil')
  3069. CopyAllHeaders('panda/src/gsgbase')
  3070. CopyAllHeaders('panda/src/pnmimage')
  3071. CopyAllHeaders('panda/src/nativenet')
  3072. CopyAllHeaders('panda/src/net')
  3073. CopyAllHeaders('panda/src/pstatclient')
  3074. CopyAllHeaders('panda/src/gobj')
  3075. CopyAllHeaders('panda/src/movies')
  3076. CopyAllHeaders('panda/src/pgraphnodes')
  3077. CopyAllHeaders('panda/src/pgraph')
  3078. CopyAllHeaders('panda/src/cull')
  3079. CopyAllHeaders('panda/src/display')
  3080. CopyAllHeaders('panda/src/chan')
  3081. CopyAllHeaders('panda/src/char')
  3082. CopyAllHeaders('panda/src/dgraph')
  3083. CopyAllHeaders('panda/src/device')
  3084. CopyAllHeaders('panda/src/pnmtext')
  3085. CopyAllHeaders('panda/src/text')
  3086. CopyAllHeaders('panda/src/grutil')
  3087. if (PkgSkip("VISION")==0):
  3088. CopyAllHeaders('panda/src/vision')
  3089. if (PkgSkip("FFMPEG")==0):
  3090. CopyAllHeaders('panda/src/ffmpeg')
  3091. CopyAllHeaders('panda/src/tform')
  3092. CopyAllHeaders('panda/src/collide')
  3093. CopyAllHeaders('panda/src/parametrics')
  3094. CopyAllHeaders('panda/src/pgui')
  3095. CopyAllHeaders('panda/src/pnmimagetypes')
  3096. CopyAllHeaders('panda/src/recorder')
  3097. if (PkgSkip("ROCKET")==0):
  3098. CopyAllHeaders('panda/src/rocket')
  3099. if (PkgSkip("VRPN")==0):
  3100. CopyAllHeaders('panda/src/vrpn')
  3101. CopyAllHeaders('panda/src/wgldisplay')
  3102. CopyAllHeaders('panda/src/ode')
  3103. CopyAllHeaders('panda/metalibs/pandaode')
  3104. if (PkgSkip("PANDAPHYSICS")==0):
  3105. CopyAllHeaders('panda/src/physics')
  3106. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3107. CopyAllHeaders('panda/src/particlesystem')
  3108. CopyAllHeaders('panda/src/dxml')
  3109. CopyAllHeaders('panda/metalibs/panda')
  3110. CopyAllHeaders('panda/src/audiotraits')
  3111. CopyAllHeaders('panda/src/audiotraits')
  3112. CopyAllHeaders('panda/src/distort')
  3113. CopyAllHeaders('panda/src/downloadertools')
  3114. CopyAllHeaders('panda/src/windisplay')
  3115. CopyAllHeaders('panda/src/dxgsg9')
  3116. CopyAllHeaders('panda/metalibs/pandadx9')
  3117. if not PkgSkip("EGG"):
  3118. CopyAllHeaders('panda/src/egg')
  3119. CopyAllHeaders('panda/src/egg2pg')
  3120. CopyAllHeaders('panda/src/framework')
  3121. CopyAllHeaders('panda/metalibs/pandafx')
  3122. CopyAllHeaders('panda/src/glstuff')
  3123. CopyAllHeaders('panda/src/glgsg')
  3124. CopyAllHeaders('panda/src/glesgsg')
  3125. CopyAllHeaders('panda/src/gles2gsg')
  3126. if not PkgSkip("EGG"):
  3127. CopyAllHeaders('panda/metalibs/pandaegg')
  3128. if GetTarget() == 'windows':
  3129. CopyAllHeaders('panda/src/wgldisplay')
  3130. elif GetTarget() == 'darwin':
  3131. CopyAllHeaders('panda/src/osxdisplay')
  3132. CopyAllHeaders('panda/src/cocoadisplay')
  3133. elif GetTarget() == 'android':
  3134. CopyAllHeaders('panda/src/android')
  3135. CopyAllHeaders('panda/src/androiddisplay')
  3136. else:
  3137. CopyAllHeaders('panda/src/x11display')
  3138. CopyAllHeaders('panda/src/glxdisplay')
  3139. CopyAllHeaders('panda/src/egldisplay')
  3140. CopyAllHeaders('panda/metalibs/pandagl')
  3141. CopyAllHeaders('panda/metalibs/pandagles')
  3142. CopyAllHeaders('panda/metalibs/pandagles2')
  3143. CopyAllHeaders('panda/metalibs/pandaphysics')
  3144. CopyAllHeaders('panda/src/testbed')
  3145. if (PkgSkip("PHYSX")==0):
  3146. CopyAllHeaders('panda/src/physx')
  3147. CopyAllHeaders('panda/metalibs/pandaphysx')
  3148. if (PkgSkip("BULLET")==0):
  3149. CopyAllHeaders('panda/src/bullet')
  3150. CopyAllHeaders('panda/metalibs/pandabullet')
  3151. if (PkgSkip("SPEEDTREE")==0):
  3152. CopyAllHeaders('panda/src/speedtree')
  3153. if (PkgSkip("DIRECT")==0):
  3154. CopyAllHeaders('direct/src/directbase')
  3155. CopyAllHeaders('direct/src/dcparser')
  3156. CopyAllHeaders('direct/src/deadrec')
  3157. CopyAllHeaders('direct/src/distributed')
  3158. CopyAllHeaders('direct/src/interval')
  3159. CopyAllHeaders('direct/src/showbase')
  3160. CopyAllHeaders('direct/src/dcparse')
  3161. if (RUNTIME or RTDIST):
  3162. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3163. if (RUNTIME):
  3164. CopyAllHeaders('direct/src/plugin_npapi')
  3165. CopyAllHeaders('direct/src/plugin_standalone')
  3166. if (PkgSkip("PANDATOOL")==0):
  3167. CopyAllHeaders('pandatool/src/pandatoolbase')
  3168. CopyAllHeaders('pandatool/src/converter')
  3169. CopyAllHeaders('pandatool/src/progbase')
  3170. CopyAllHeaders('pandatool/src/eggbase')
  3171. CopyAllHeaders('pandatool/src/bam')
  3172. CopyAllHeaders('pandatool/src/cvscopy')
  3173. CopyAllHeaders('pandatool/src/daeegg')
  3174. CopyAllHeaders('pandatool/src/daeprogs')
  3175. CopyAllHeaders('pandatool/src/dxf')
  3176. CopyAllHeaders('pandatool/src/dxfegg')
  3177. CopyAllHeaders('pandatool/src/dxfprogs')
  3178. CopyAllHeaders('pandatool/src/palettizer')
  3179. CopyAllHeaders('pandatool/src/egg-mkfont')
  3180. CopyAllHeaders('pandatool/src/eggcharbase')
  3181. CopyAllHeaders('pandatool/src/egg-optchar')
  3182. CopyAllHeaders('pandatool/src/egg-palettize')
  3183. CopyAllHeaders('pandatool/src/egg-qtess')
  3184. CopyAllHeaders('pandatool/src/eggprogs')
  3185. CopyAllHeaders('pandatool/src/flt')
  3186. CopyAllHeaders('pandatool/src/fltegg')
  3187. CopyAllHeaders('pandatool/src/fltprogs')
  3188. CopyAllHeaders('pandatool/src/imagebase')
  3189. CopyAllHeaders('pandatool/src/imageprogs')
  3190. CopyAllHeaders('pandatool/src/pfmprogs')
  3191. CopyAllHeaders('pandatool/src/lwo')
  3192. CopyAllHeaders('pandatool/src/lwoegg')
  3193. CopyAllHeaders('pandatool/src/lwoprogs')
  3194. CopyAllHeaders('pandatool/src/maya')
  3195. CopyAllHeaders('pandatool/src/mayaegg')
  3196. CopyAllHeaders('pandatool/src/maxegg')
  3197. CopyAllHeaders('pandatool/src/maxprogs')
  3198. CopyAllHeaders('pandatool/src/objegg')
  3199. CopyAllHeaders('pandatool/src/objprogs')
  3200. CopyAllHeaders('pandatool/src/vrml')
  3201. CopyAllHeaders('pandatool/src/vrmlegg')
  3202. CopyAllHeaders('pandatool/src/xfile')
  3203. CopyAllHeaders('pandatool/src/xfileegg')
  3204. CopyAllHeaders('pandatool/src/ptloader')
  3205. CopyAllHeaders('pandatool/src/miscprogs')
  3206. CopyAllHeaders('pandatool/src/pstatserver')
  3207. CopyAllHeaders('pandatool/src/text-stats')
  3208. CopyAllHeaders('pandatool/src/vrmlprogs')
  3209. CopyAllHeaders('pandatool/src/win-stats')
  3210. CopyAllHeaders('pandatool/src/xfileprogs')
  3211. if (PkgSkip("CONTRIB")==0):
  3212. CopyAllHeaders('contrib/src/contribbase')
  3213. CopyAllHeaders('contrib/src/ai')
  3214. ########################################################################
  3215. #
  3216. # These definitions are syntactic shorthand. They make it easy
  3217. # to link with the usual libraries without listing them all.
  3218. #
  3219. ########################################################################
  3220. COMMON_DTOOL_LIBS=[
  3221. 'libp3dtool.dll',
  3222. 'libp3dtoolconfig.dll',
  3223. ]
  3224. COMMON_PANDA_LIBS=[
  3225. 'libpanda.dll',
  3226. 'libpandaexpress.dll'
  3227. ] + COMMON_DTOOL_LIBS
  3228. COMMON_EGG2X_LIBS=[
  3229. 'libp3eggbase.lib',
  3230. 'libp3progbase.lib',
  3231. 'libp3converter.lib',
  3232. 'libp3pandatoolbase.lib',
  3233. 'libpandaegg.dll',
  3234. ] + COMMON_PANDA_LIBS
  3235. ########################################################################
  3236. #
  3237. # This section contains a list of all the files that need to be compiled.
  3238. #
  3239. ########################################################################
  3240. print("Generating dependencies...")
  3241. sys.stdout.flush()
  3242. #
  3243. # Compile Panda icon resource file.
  3244. # We do it first because we need it at
  3245. # the time we compile an executable.
  3246. #
  3247. if GetTarget() == 'windows':
  3248. OPTS=['DIR:panda/src/configfiles']
  3249. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3250. #
  3251. # DIRECTORY: dtool/src/dtoolbase/
  3252. #
  3253. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3254. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3255. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3256. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3257. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3258. #
  3259. # DIRECTORY: dtool/src/dtoolutil/
  3260. #
  3261. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3262. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3263. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3264. if GetTarget() == 'darwin':
  3265. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3266. #
  3267. # DIRECTORY: dtool/metalibs/dtool/
  3268. #
  3269. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3270. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3271. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3272. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3273. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3274. if GetTarget() == 'darwin':
  3275. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3276. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3277. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3278. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3279. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3280. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3281. #
  3282. # DIRECTORY: dtool/src/cppparser/
  3283. #
  3284. if (not RUNTIME):
  3285. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3286. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3287. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3288. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3289. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3290. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3291. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3292. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3293. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3294. #
  3295. # DIRECTORY: dtool/src/prc/
  3296. #
  3297. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3298. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3299. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3300. #
  3301. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3302. #
  3303. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3304. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3305. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3306. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3307. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3308. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3309. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3310. #
  3311. # DIRECTORY: dtool/src/interrogatedb/
  3312. #
  3313. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3314. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3315. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3316. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3317. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3318. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3319. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3320. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3321. # stuff, so it has been renamed appropriately.
  3322. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3323. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3324. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3325. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3326. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3327. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3328. #
  3329. # DIRECTORY: dtool/src/pystub/
  3330. #
  3331. if not RUNTIME and not RTDIST:
  3332. OPTS=['DIR:dtool/src/pystub']
  3333. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3334. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3335. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3336. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3337. #
  3338. # DIRECTORY: dtool/src/interrogate/
  3339. #
  3340. if (not RUNTIME):
  3341. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3342. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3343. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3344. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3345. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3346. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3347. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3348. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3349. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3350. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3351. 'dtool/src/interrogatedb/py_panda.cxx',
  3352. 'dtool/src/interrogatedb/py_compat.cxx',
  3353. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3354. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3355. ])
  3356. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3357. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3358. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3359. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3360. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3361. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3362. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3363. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3364. if (not RTDIST):
  3365. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3366. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3367. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3368. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3369. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3370. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3371. #
  3372. # DIRECTORY: dtool/src/prckeys/
  3373. #
  3374. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3375. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3376. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3377. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3378. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3379. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3380. #
  3381. # DIRECTORY: dtool/src/test_interrogate/
  3382. #
  3383. if (not RTDIST and not RUNTIME):
  3384. OPTS=['DIR:dtool/src/test_interrogate']
  3385. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3386. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3387. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3388. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3389. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3390. #
  3391. # DIRECTORY: dtool/src/dtoolbase/
  3392. #
  3393. OPTS=['DIR:dtool/src/dtoolbase']
  3394. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3395. IGATEFILES += [
  3396. "typeHandle.h",
  3397. "typeHandle_ext.h",
  3398. "typeRegistry.h",
  3399. "typedObject.h",
  3400. "neverFreeMemory.h",
  3401. ]
  3402. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3403. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3404. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3405. #
  3406. # DIRECTORY: dtool/src/dtoolutil/
  3407. #
  3408. OPTS=['DIR:dtool/src/dtoolutil']
  3409. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3410. IGATEFILES += [
  3411. "config_dtoolutil.h",
  3412. "pandaSystem.h",
  3413. "dSearchPath.h",
  3414. "executionEnvironment.h",
  3415. "textEncoder.h",
  3416. "textEncoder_ext.h",
  3417. "filename.h",
  3418. "filename_ext.h",
  3419. "globPattern.h",
  3420. "globPattern_ext.h",
  3421. "pandaFileStream.h",
  3422. "lineStream.h",
  3423. ]
  3424. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3425. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3426. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3427. #
  3428. # DIRECTORY: dtool/src/prc/
  3429. #
  3430. OPTS=['DIR:dtool/src/prc']
  3431. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3432. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3433. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3434. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3435. #
  3436. # DIRECTORY: panda/src/pandabase/
  3437. #
  3438. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3439. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3440. #
  3441. # DIRECTORY: panda/src/express/
  3442. #
  3443. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3444. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3445. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3446. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3447. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3448. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3449. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3450. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3451. #
  3452. # DIRECTORY: panda/src/downloader/
  3453. #
  3454. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3455. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3456. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3457. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3458. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3459. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3460. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3461. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3462. #
  3463. # DIRECTORY: panda/metalibs/pandaexpress/
  3464. #
  3465. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3466. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3467. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3468. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3469. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3470. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3471. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3472. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3473. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3474. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3475. #
  3476. # DIRECTORY: panda/src/pipeline/
  3477. #
  3478. if (not RUNTIME):
  3479. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3480. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3481. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3482. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3483. OPTS=['DIR:panda/src/pipeline']
  3484. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3485. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3486. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3487. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3488. #
  3489. # DIRECTORY: panda/src/linmath/
  3490. #
  3491. if (not RUNTIME):
  3492. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3493. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3494. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3495. OPTS=['DIR:panda/src/linmath']
  3496. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3497. for ifile in IGATEFILES[:]:
  3498. if "_src." in ifile:
  3499. IGATEFILES.remove(ifile)
  3500. IGATEFILES.remove('cast_to_double.h')
  3501. IGATEFILES.remove('lmat_ops.h')
  3502. IGATEFILES.remove('cast_to_float.h')
  3503. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3504. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3505. #
  3506. # DIRECTORY: panda/src/putil/
  3507. #
  3508. if (not RUNTIME):
  3509. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3510. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3511. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3512. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3513. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3514. IGATEFILES.remove("test_bam.h")
  3515. IGATEFILES.remove("config_util.h")
  3516. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3517. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3518. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3519. #
  3520. # DIRECTORY: panda/src/audio/
  3521. #
  3522. if (not RUNTIME):
  3523. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3524. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3525. OPTS=['DIR:panda/src/audio']
  3526. IGATEFILES=["audio.h"]
  3527. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3528. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3529. #
  3530. # DIRECTORY: panda/src/event/
  3531. #
  3532. if (not RUNTIME):
  3533. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3534. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3535. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3536. OPTS=['DIR:panda/src/event']
  3537. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3538. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3539. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3540. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3541. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3542. #
  3543. # DIRECTORY: panda/src/mathutil/
  3544. #
  3545. if (not RUNTIME):
  3546. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3547. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3548. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3549. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3550. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3551. for ifile in IGATEFILES[:]:
  3552. if "_src." in ifile:
  3553. IGATEFILES.remove(ifile)
  3554. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3555. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3556. #
  3557. # DIRECTORY: panda/src/gsgbase/
  3558. #
  3559. if (not RUNTIME):
  3560. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3561. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3562. OPTS=['DIR:panda/src/gsgbase']
  3563. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3564. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3565. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3566. #
  3567. # DIRECTORY: panda/src/pnmimage/
  3568. #
  3569. if (not RUNTIME):
  3570. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3571. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3572. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3573. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3574. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3575. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3576. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3577. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3578. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3579. #
  3580. # DIRECTORY: panda/src/nativenet/
  3581. #
  3582. if (not RUNTIME):
  3583. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3584. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3585. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3586. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3587. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3588. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3589. #
  3590. # DIRECTORY: panda/src/net/
  3591. #
  3592. if (not RUNTIME):
  3593. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3594. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3595. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3596. OPTS=['DIR:panda/src/net']
  3597. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3598. IGATEFILES.remove("datagram_ui.h")
  3599. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3600. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3601. #
  3602. # DIRECTORY: panda/src/pstatclient/
  3603. #
  3604. if (not RUNTIME):
  3605. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3606. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3607. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3608. OPTS=['DIR:panda/src/pstatclient']
  3609. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3610. IGATEFILES.remove("config_pstats.h")
  3611. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3612. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3613. #
  3614. # DIRECTORY: panda/src/gobj/
  3615. #
  3616. if (not RUNTIME):
  3617. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3618. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3619. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3620. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3621. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3622. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3623. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3624. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3625. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3626. #
  3627. # DIRECTORY: panda/src/pgraphnodes/
  3628. #
  3629. if (not RUNTIME):
  3630. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3631. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3632. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3633. OPTS=['DIR:panda/src/pgraphnodes']
  3634. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3635. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3636. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3637. #
  3638. # DIRECTORY: panda/src/pgraph/
  3639. #
  3640. if (not RUNTIME):
  3641. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3642. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3643. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3644. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3645. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3646. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3647. OPTS=['DIR:panda/src/pgraph']
  3648. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3649. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3650. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3651. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3652. #
  3653. # DIRECTORY: panda/src/cull/
  3654. #
  3655. if (not RUNTIME):
  3656. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3657. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3658. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3659. OPTS=['DIR:panda/src/cull']
  3660. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3661. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3662. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3663. #
  3664. # DIRECTORY: panda/src/dgraph/
  3665. #
  3666. if (not RUNTIME):
  3667. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3668. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3669. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3670. OPTS=['DIR:panda/src/dgraph']
  3671. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3672. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3673. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3674. #
  3675. # DIRECTORY: panda/src/device/
  3676. #
  3677. if (not RUNTIME):
  3678. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3679. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3680. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3681. OPTS=['DIR:panda/src/device']
  3682. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3683. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3684. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3685. #
  3686. # DIRECTORY: panda/src/display/
  3687. #
  3688. if (not RUNTIME):
  3689. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3690. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3691. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3692. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3693. OPTS=['DIR:panda/src/display', 'X11']
  3694. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3695. IGATEFILES.remove("renderBuffer.h")
  3696. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3697. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3698. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3699. if RTDIST and GetTarget() == 'darwin':
  3700. OPTS=['DIR:panda/src/display']
  3701. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3702. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3703. #
  3704. # DIRECTORY: panda/src/chan/
  3705. #
  3706. if (not RUNTIME):
  3707. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3708. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3709. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3710. OPTS=['DIR:panda/src/chan']
  3711. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3712. IGATEFILES.remove('movingPart.h')
  3713. IGATEFILES.remove('animChannelFixed.h')
  3714. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3715. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3716. # DIRECTORY: panda/src/char/
  3717. #
  3718. if (not RUNTIME):
  3719. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3720. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3721. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3722. OPTS=['DIR:panda/src/char']
  3723. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3724. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3725. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3726. #
  3727. # DIRECTORY: panda/src/pnmtext/
  3728. #
  3729. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3730. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3731. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3732. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3733. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3734. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3735. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3736. #
  3737. # DIRECTORY: panda/src/text/
  3738. #
  3739. if (not RUNTIME):
  3740. if not PkgSkip("HARFBUZZ"):
  3741. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3742. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3743. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3744. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3745. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3746. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3747. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3748. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3749. #
  3750. # DIRECTORY: panda/src/movies/
  3751. #
  3752. if (not RUNTIME):
  3753. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3754. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3755. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3756. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3757. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3758. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3759. #
  3760. # DIRECTORY: panda/src/grutil/
  3761. #
  3762. if (not RUNTIME):
  3763. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3764. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3765. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3766. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3767. OPTS=['DIR:panda/src/grutil']
  3768. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3769. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3770. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3771. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3772. #
  3773. # DIRECTORY: panda/src/tform/
  3774. #
  3775. if (not RUNTIME):
  3776. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3777. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3778. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3779. OPTS=['DIR:panda/src/tform']
  3780. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3781. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3782. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3783. #
  3784. # DIRECTORY: panda/src/collide/
  3785. #
  3786. if (not RUNTIME):
  3787. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3788. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3789. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3790. OPTS=['DIR:panda/src/collide']
  3791. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3792. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3793. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3794. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3795. #
  3796. # DIRECTORY: panda/src/parametrics/
  3797. #
  3798. if (not RUNTIME):
  3799. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3800. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3801. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3802. OPTS=['DIR:panda/src/parametrics']
  3803. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3804. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3805. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3806. #
  3807. # DIRECTORY: panda/src/pgui/
  3808. #
  3809. if (not RUNTIME):
  3810. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3811. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3812. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3813. OPTS=['DIR:panda/src/pgui']
  3814. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3815. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3816. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3817. #
  3818. # DIRECTORY: panda/src/pnmimagetypes/
  3819. #
  3820. if (not RUNTIME):
  3821. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3822. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3823. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3824. #
  3825. # DIRECTORY: panda/src/recorder/
  3826. #
  3827. if (not RUNTIME):
  3828. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3829. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3830. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3831. OPTS=['DIR:panda/src/recorder']
  3832. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3833. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3834. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3835. #
  3836. # DIRECTORY: panda/src/dxml/
  3837. #
  3838. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3839. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3840. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3841. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3842. if (not RUNTIME):
  3843. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3844. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3845. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3846. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3847. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3848. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3849. #
  3850. # DIRECTORY: panda/metalibs/panda/
  3851. #
  3852. if (not RUNTIME):
  3853. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3854. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3855. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3856. 'SETUPAPI']
  3857. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3858. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3859. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3860. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3861. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3862. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3863. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3864. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3865. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3866. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3867. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3868. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3869. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3870. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3871. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3872. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3873. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3874. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3875. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3876. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3877. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3878. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3879. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3880. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3881. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3882. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3883. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3884. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3885. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3886. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3887. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3888. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3889. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3890. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3891. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3892. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3893. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3894. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3895. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3896. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3897. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3898. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3899. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3900. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3901. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3902. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3903. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3904. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3905. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3906. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3907. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3908. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3909. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3910. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3911. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3912. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3913. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3914. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3915. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3916. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3917. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3918. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3919. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3920. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3921. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3922. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3923. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3924. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3925. if PkgSkip("FREETYPE")==0:
  3926. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3927. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3928. TargetAdd('libpanda.dll', opts=OPTS)
  3929. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3930. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3931. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3932. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3933. PyTargetAdd('core_module.obj', input='libp3express.in')
  3934. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3935. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3936. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3937. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3938. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3939. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3940. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3941. PyTargetAdd('core_module.obj', input='libp3char.in')
  3942. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3943. PyTargetAdd('core_module.obj', input='libp3device.in')
  3944. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3945. PyTargetAdd('core_module.obj', input='libp3display.in')
  3946. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3947. PyTargetAdd('core_module.obj', input='libp3event.in')
  3948. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3949. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3950. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3951. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3952. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3953. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3954. PyTargetAdd('core_module.obj', input='libp3text.in')
  3955. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3956. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3957. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3958. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3959. PyTargetAdd('core_module.obj', input='libp3net.in')
  3960. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3961. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3962. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3963. if PkgSkip("FREETYPE")==0:
  3964. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3965. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3966. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3967. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3968. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3969. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3970. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3971. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3972. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3973. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3974. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3975. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3976. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3977. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3978. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3979. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3980. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3981. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3982. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3983. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3984. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3985. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3986. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3987. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3988. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3989. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3990. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3991. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3992. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3993. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3994. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3995. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3996. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  3997. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  3998. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  3999. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4000. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4001. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4002. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4003. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4004. if PkgSkip("FREETYPE")==0:
  4005. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4006. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4007. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4008. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4009. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4010. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4011. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4012. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4013. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4014. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4015. PyTargetAdd('core.pyd', input='core_module.obj')
  4016. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4017. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4018. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4019. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4020. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4021. #
  4022. # DIRECTORY: panda/src/vision/
  4023. #
  4024. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4025. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4026. if not PkgSkip("FFMPEG"):
  4027. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4028. if not PkgSkip("OPENCV"):
  4029. DefSymbol("OPENCV", "HAVE_OPENCV")
  4030. if OPENCV_VER_23:
  4031. DefSymbol("OPENCV", "OPENCV_VER_23")
  4032. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4033. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4034. 'dtool_have_ffmpeg.dat',
  4035. 'dtool_have_opencv.dat',
  4036. 'dtool_have_directcam.dat',
  4037. ])
  4038. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4039. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4040. TargetAdd('libp3vision.dll', opts=OPTS)
  4041. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4042. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4043. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4044. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4045. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4046. PyTargetAdd('vision_module.obj', opts=OPTS)
  4047. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4048. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4049. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4050. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4051. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4052. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4053. #
  4054. # DIRECTORY: panda/src/rocket/
  4055. #
  4056. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4057. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4058. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4059. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4060. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4061. TargetAdd('libp3rocket.dll', opts=OPTS)
  4062. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4063. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4064. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4065. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4066. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4067. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4068. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4069. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4070. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4071. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4072. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4073. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4074. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4075. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4076. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4077. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4078. #
  4079. # DIRECTORY: panda/src/p3skel
  4080. #
  4081. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4082. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4083. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4084. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4085. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4086. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4087. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4088. #
  4089. # DIRECTORY: panda/src/p3skel
  4090. #
  4091. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4092. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4093. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4094. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4095. TargetAdd('libpandaskel.dll', opts=OPTS)
  4096. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4097. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4098. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4099. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4100. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4101. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4102. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4103. #
  4104. # DIRECTORY: panda/src/distort/
  4105. #
  4106. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4107. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4108. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4109. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4110. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4111. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4112. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4113. #
  4114. # DIRECTORY: panda/metalibs/pandafx/
  4115. #
  4116. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4117. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4118. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4119. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4120. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4121. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4122. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4123. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4124. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4125. PyTargetAdd('fx_module.obj', opts=OPTS)
  4126. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4127. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4128. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4129. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4130. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4131. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4132. #
  4133. # DIRECTORY: panda/src/vrpn/
  4134. #
  4135. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4136. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4137. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4138. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4139. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4140. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4141. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4142. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4143. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4144. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4145. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4146. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4147. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4148. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4149. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4150. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4151. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4152. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4153. #
  4154. # DIRECTORY: panda/src/ffmpeg
  4155. #
  4156. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4157. if not PkgSkip("SWSCALE"):
  4158. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4159. if not PkgSkip("SWRESAMPLE"):
  4160. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4161. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4162. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4163. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4164. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4165. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4166. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4167. #
  4168. # DIRECTORY: panda/src/audiotraits/
  4169. #
  4170. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4171. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4172. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4173. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4174. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4175. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4176. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4177. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4178. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4179. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4180. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4181. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4182. #
  4183. # DIRECTORY: panda/src/downloadertools/
  4184. #
  4185. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4186. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4187. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4188. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4189. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4190. TargetAdd('apply_patch.exe', opts=OPTS)
  4191. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4192. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4193. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4194. TargetAdd('build_patch.exe', opts=OPTS)
  4195. if not PkgSkip("ZLIB"):
  4196. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4197. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4198. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4199. TargetAdd('check_adler.exe', opts=OPTS)
  4200. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4201. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4202. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4203. TargetAdd('check_crc.exe', opts=OPTS)
  4204. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4205. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4206. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4207. TargetAdd('check_md5.exe', opts=OPTS)
  4208. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4209. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4210. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4211. TargetAdd('pdecrypt.exe', opts=OPTS)
  4212. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4213. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4214. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4215. TargetAdd('pencrypt.exe', opts=OPTS)
  4216. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4217. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4218. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4219. TargetAdd('show_ddb.exe', opts=OPTS)
  4220. #
  4221. # DIRECTORY: panda/src/downloadertools/
  4222. #
  4223. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4224. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4225. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4226. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4227. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4228. TargetAdd('multify.exe', opts=OPTS)
  4229. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4230. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4231. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4232. TargetAdd('pzip.exe', opts=OPTS)
  4233. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4234. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4235. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4236. TargetAdd('punzip.exe', opts=OPTS)
  4237. #
  4238. # DIRECTORY: panda/src/windisplay/
  4239. #
  4240. if (GetTarget() == 'windows' and not RUNTIME):
  4241. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4242. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4243. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4244. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4245. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4246. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4247. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4248. #
  4249. # DIRECTORY: panda/metalibs/pandadx9/
  4250. #
  4251. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4252. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4253. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4254. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4255. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4256. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4257. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4258. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4259. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4260. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4261. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4262. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4263. #
  4264. # DIRECTORY: panda/src/egg/
  4265. #
  4266. if not RUNTIME and not PkgSkip("EGG"):
  4267. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4268. CreateFile(GetOutputDir()+"/include/parser.h")
  4269. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4270. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4271. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4272. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4273. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4274. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4275. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4276. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4277. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4278. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4279. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4280. #
  4281. # DIRECTORY: panda/src/egg2pg/
  4282. #
  4283. if not RUNTIME and not PkgSkip("EGG"):
  4284. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4285. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4286. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4287. OPTS=['DIR:panda/src/egg2pg']
  4288. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4289. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4290. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4291. #
  4292. # DIRECTORY: panda/src/framework/
  4293. #
  4294. if (not RUNTIME):
  4295. deps = []
  4296. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4297. if GetLinkAllStatic():
  4298. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4299. if not PkgSkip("GL"):
  4300. DefSymbol("FRAMEWORK", "HAVE_GL")
  4301. if not PkgSkip("TINYDISPLAY"):
  4302. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4303. if not PkgSkip("EGG"):
  4304. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4305. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4306. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4307. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4308. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4309. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4310. #
  4311. # DIRECTORY: panda/src/glgsg/
  4312. #
  4313. if (not RUNTIME and PkgSkip("GL")==0):
  4314. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4315. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4316. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4317. #
  4318. # DIRECTORY: panda/src/glesgsg/
  4319. #
  4320. if (not RUNTIME and PkgSkip("GLES")==0):
  4321. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4322. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4323. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4324. #
  4325. # DIRECTORY: panda/src/gles2gsg/
  4326. #
  4327. if (not RUNTIME and PkgSkip("GLES2")==0):
  4328. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4329. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4330. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4331. #
  4332. # DIRECTORY: panda/metalibs/pandaegg/
  4333. #
  4334. if not RUNTIME and not PkgSkip("EGG"):
  4335. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4336. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4337. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4338. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4339. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4340. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4341. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4342. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4343. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4344. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4345. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4346. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4347. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4348. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4349. PyTargetAdd('egg_module.obj', opts=OPTS)
  4350. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4351. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4352. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4353. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4354. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4355. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4356. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4357. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4358. #
  4359. # DIRECTORY: panda/src/x11display/
  4360. #
  4361. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4362. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4363. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4364. #
  4365. # DIRECTORY: panda/src/glxdisplay/
  4366. #
  4367. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4368. DefSymbol('GLX', 'HAVE_GLX', '')
  4369. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4370. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4371. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4372. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4373. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4374. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4375. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4376. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4377. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4378. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4379. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4380. #
  4381. # DIRECTORY: panda/src/cocoadisplay/
  4382. #
  4383. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4384. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4385. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4386. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4387. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4388. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4389. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4390. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4391. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4392. if (PkgSkip('PANDAFX')==0):
  4393. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4394. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4395. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4396. #
  4397. # DIRECTORY: panda/src/osxdisplay/
  4398. #
  4399. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4400. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4401. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4402. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4403. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4404. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4405. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4406. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4407. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4408. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4409. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4410. if (PkgSkip('PANDAFX')==0):
  4411. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4412. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4413. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4414. #
  4415. # DIRECTORY: panda/src/wgldisplay/
  4416. #
  4417. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4418. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4419. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4420. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4421. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4422. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4423. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4424. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4425. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4426. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4427. if (PkgSkip('PANDAFX')==0):
  4428. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4429. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4430. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4431. #
  4432. # DIRECTORY: panda/src/egldisplay/
  4433. #
  4434. # If we're not compiling with any windowing system at all, but we do have EGL,
  4435. # we can use that to create a headless libpandagl instead.
  4436. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4437. DefSymbol('EGL', 'HAVE_EGL', '')
  4438. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4439. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4440. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4441. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4442. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4443. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4444. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4445. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4446. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4447. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4448. #
  4449. # DIRECTORY: panda/src/egldisplay/
  4450. #
  4451. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4452. DefSymbol('GLES', 'OPENGLES_1', '')
  4453. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4454. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4455. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4456. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4457. if not PkgSkip("X11"):
  4458. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4459. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4460. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4461. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4462. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4463. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4464. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4465. #
  4466. # DIRECTORY: panda/src/egldisplay/
  4467. #
  4468. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4469. DefSymbol('GLES2', 'OPENGLES_2', '')
  4470. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4471. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4472. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4473. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4474. if not PkgSkip("X11"):
  4475. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4476. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4477. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4478. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4479. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4480. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4481. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4482. #
  4483. # DIRECTORY: panda/src/ode/
  4484. #
  4485. if (PkgSkip("ODE")==0 and not RUNTIME):
  4486. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4487. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4488. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4489. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4490. OPTS=['DIR:panda/src/ode', 'ODE']
  4491. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4492. IGATEFILES.remove("odeConvexGeom.h")
  4493. IGATEFILES.remove("odeHelperStructs.h")
  4494. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4495. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4496. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4497. #
  4498. # DIRECTORY: panda/metalibs/pandaode/
  4499. #
  4500. if (PkgSkip("ODE")==0 and not RUNTIME):
  4501. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4502. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4503. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4504. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4505. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4506. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4507. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4508. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4509. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4510. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4511. PyTargetAdd('ode_module.obj', opts=OPTS)
  4512. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4513. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4514. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4515. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4516. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4517. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4518. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4519. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4520. #
  4521. # DIRECTORY: panda/src/bullet/
  4522. #
  4523. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4524. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4525. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4526. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4527. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4528. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4529. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4530. #
  4531. # DIRECTORY: panda/metalibs/pandabullet/
  4532. #
  4533. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4534. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4535. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4536. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4537. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4538. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4539. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4540. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4541. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4542. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4543. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4544. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4545. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4546. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4547. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4548. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4549. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4550. #
  4551. # DIRECTORY: panda/src/physx/
  4552. #
  4553. if (PkgSkip("PHYSX")==0):
  4554. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4555. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4556. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4557. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4558. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4559. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4560. #
  4561. # DIRECTORY: panda/metalibs/pandaphysx/
  4562. #
  4563. if (PkgSkip("PHYSX")==0):
  4564. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4565. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4566. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4567. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4568. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4569. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4570. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4571. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4572. PyTargetAdd('physx_module.obj', opts=OPTS)
  4573. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4574. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4575. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4576. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4577. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4578. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4579. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4580. #
  4581. # DIRECTORY: panda/src/physics/
  4582. #
  4583. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4584. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4585. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4586. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4587. OPTS=['DIR:panda/src/physics']
  4588. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4589. IGATEFILES.remove("forces.h")
  4590. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4591. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4592. #
  4593. # DIRECTORY: panda/src/particlesystem/
  4594. #
  4595. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4596. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4597. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4598. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4599. OPTS=['DIR:panda/src/particlesystem']
  4600. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4601. IGATEFILES.remove('orientedParticle.h')
  4602. IGATEFILES.remove('orientedParticleFactory.h')
  4603. IGATEFILES.remove('particlefactories.h')
  4604. IGATEFILES.remove('emitters.h')
  4605. IGATEFILES.remove('particles.h')
  4606. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4607. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4608. #
  4609. # DIRECTORY: panda/metalibs/pandaphysics/
  4610. #
  4611. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4612. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4613. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4614. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4615. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4616. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4617. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4618. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4619. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4620. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4621. OPTS=['DIR:panda/metalibs/pandaphysics']
  4622. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4623. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4624. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4625. PyTargetAdd('physics_module.obj', opts=OPTS)
  4626. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4627. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4628. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4629. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4630. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4631. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4632. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4633. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4634. #
  4635. # DIRECTORY: panda/src/speedtree/
  4636. #
  4637. if (PkgSkip("SPEEDTREE")==0):
  4638. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4639. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4640. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4641. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4642. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4643. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4644. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4645. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4646. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4647. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4648. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4649. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4650. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4651. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4652. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4653. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4654. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4655. #
  4656. # DIRECTORY: panda/src/testbed/
  4657. #
  4658. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4659. OPTS=['DIR:panda/src/testbed']
  4660. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4661. TargetAdd('pview.exe', input='pview_pview.obj')
  4662. TargetAdd('pview.exe', input='libp3framework.dll')
  4663. if not PkgSkip("EGG"):
  4664. TargetAdd('pview.exe', input='libpandaegg.dll')
  4665. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4666. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4667. if GetLinkAllStatic() and not PkgSkip("GL"):
  4668. TargetAdd('pview.exe', input='libpandagl.dll')
  4669. #
  4670. # DIRECTORY: panda/src/android/
  4671. #
  4672. if (not RUNTIME and GetTarget() == 'android'):
  4673. OPTS=['DIR:panda/src/android']
  4674. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4675. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4676. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4677. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4678. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4679. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4680. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4681. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4682. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4683. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4684. if (not RTDIST and PkgSkip("PVIEW")==0):
  4685. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4686. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4687. TargetAdd('libpview.dll', input='android_main.obj')
  4688. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4689. TargetAdd('libpview.dll', input='libp3framework.dll')
  4690. if not PkgSkip("EGG"):
  4691. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4692. TargetAdd('libpview.dll', input='libp3android.dll')
  4693. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4694. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4695. if (not RTDIST and PkgSkip("PYTHON")==0):
  4696. OPTS += ['PYTHON']
  4697. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4698. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4699. TargetAdd('libppython.dll', input='android_main.obj')
  4700. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4701. TargetAdd('libppython.dll', input='libp3framework.dll')
  4702. TargetAdd('libppython.dll', input='libp3android.dll')
  4703. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4704. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4705. #
  4706. # DIRECTORY: panda/src/androiddisplay/
  4707. #
  4708. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4709. DefSymbol('GLES', 'OPENGLES_1', '')
  4710. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4711. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4712. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4713. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4714. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4715. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4716. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4717. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4718. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4719. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4720. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4721. #
  4722. # DIRECTORY: panda/src/tinydisplay/
  4723. #
  4724. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4725. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4726. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4727. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4728. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4729. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4730. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4731. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4732. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4733. if GetTarget() == 'darwin':
  4734. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4735. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4736. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4737. elif GetTarget() == 'windows':
  4738. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4739. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4740. else:
  4741. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4742. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4743. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4744. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4745. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4746. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4747. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4748. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4749. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4750. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4751. #
  4752. # DIRECTORY: direct/src/directbase/
  4753. #
  4754. if (PkgSkip("DIRECT")==0):
  4755. OPTS=['DIR:direct/src/directbase']
  4756. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4757. #
  4758. # DIRECTORY: direct/src/dcparser/
  4759. #
  4760. if (PkgSkip("DIRECT")==0):
  4761. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4762. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4763. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4764. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4765. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4766. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4767. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4768. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4769. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4770. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4771. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4772. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4773. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4774. #
  4775. # DIRECTORY: direct/src/deadrec/
  4776. #
  4777. if (PkgSkip("DIRECT")==0):
  4778. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4779. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4780. OPTS=['DIR:direct/src/deadrec']
  4781. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4782. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4783. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4784. #
  4785. # DIRECTORY: direct/src/distributed/
  4786. #
  4787. if (PkgSkip("DIRECT")==0):
  4788. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4789. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4790. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4791. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4792. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4793. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4794. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4795. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4796. #
  4797. # DIRECTORY: direct/src/interval/
  4798. #
  4799. if (PkgSkip("DIRECT")==0):
  4800. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4801. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4802. OPTS=['DIR:direct/src/interval']
  4803. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4804. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4805. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4806. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4807. #
  4808. # DIRECTORY: direct/src/showbase/
  4809. #
  4810. if (PkgSkip("DIRECT")==0):
  4811. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4812. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4813. if GetTarget() == 'darwin':
  4814. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4815. OPTS=['DIR:direct/src/showbase']
  4816. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4817. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4818. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4819. #
  4820. # DIRECTORY: direct/src/motiontrail/
  4821. #
  4822. if (PkgSkip("DIRECT")==0):
  4823. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4824. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4825. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4826. OPTS=['DIR:direct/src/motiontrail']
  4827. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4828. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4829. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4830. #
  4831. # DIRECTORY: direct/metalibs/direct/
  4832. #
  4833. if (PkgSkip("DIRECT")==0):
  4834. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4835. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4836. if GetTarget() == 'darwin':
  4837. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4838. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4839. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4840. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4841. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4842. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4843. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4844. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4845. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4846. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4847. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4848. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4849. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4850. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4851. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4852. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4853. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4854. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4855. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4856. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4857. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4858. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4859. # the Python libraries. If a C++ user needs these modules, we can move them
  4860. # back and filter out the Python-specific code.
  4861. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4862. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4863. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4864. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4865. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4866. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4867. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4868. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4869. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4870. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4871. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4872. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4873. #
  4874. # DIRECTORY: direct/src/dcparse/
  4875. #
  4876. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4877. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4878. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4879. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4880. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4881. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4882. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4883. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4884. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4885. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4886. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4887. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4888. #
  4889. # DIRECTORY: direct/src/plugin/
  4890. #
  4891. if (RTDIST or RUNTIME):
  4892. # Explicitly define this as we don't include dtool_config.h here.
  4893. if GetTarget() not in ('windows', 'darwin'):
  4894. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4895. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4896. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4897. OPTS += ['ZLIB', 'MSIMG']
  4898. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4899. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4900. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4901. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4902. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4903. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4904. if GetTarget() == 'darwin':
  4905. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4906. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4907. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4908. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4909. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4910. if (RTDIST):
  4911. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4912. TargetAdd(fname, input='plugin_plugin.obj')
  4913. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4914. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4915. TargetAdd(fname, input='plugin_parse_color.obj')
  4916. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4917. if GetTarget() == 'darwin':
  4918. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4919. TargetAdd(fname, input='plugin_fileSpec.obj')
  4920. TargetAdd(fname, input='plugin_binaryXml.obj')
  4921. TargetAdd(fname, input='plugin_handleStream.obj')
  4922. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4923. TargetAdd(fname, input='libp3tinyxml.ilb')
  4924. if GetTarget() == 'darwin':
  4925. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4926. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4927. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4928. if (PkgSkip("PYTHON")==0 and RTDIST):
  4929. # Freeze VFSImporter and its dependency modules into p3dpython.
  4930. # Mark panda3d.core as a dependency to make sure to build that first.
  4931. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4932. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4933. OPTS += ['PYTHON']
  4934. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4935. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4936. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4937. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4938. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4939. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4940. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4941. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4942. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4943. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4944. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4945. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4946. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4947. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4948. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4949. if GetTarget() == 'windows':
  4950. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4951. OPTS.append("NON_CONSOLE")
  4952. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4953. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4954. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4955. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4956. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4957. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4958. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4959. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4960. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4961. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4962. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4963. if GetTarget() == 'darwin':
  4964. OPTS += ['OPT:2']
  4965. if (PkgSkip("FLTK")==0):
  4966. OPTS.append("FLTK")
  4967. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4968. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4969. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4970. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4971. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4972. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4973. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4974. if GetTarget() == 'darwin':
  4975. OPTS += ['OPT:2']
  4976. TargetAdd('p3dcert.exe', opts=OPTS)
  4977. elif (PkgSkip("WX")==0):
  4978. OPTS += ["WX", "RTTI"]
  4979. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4980. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4981. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4982. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4983. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4984. if GetTarget() == "darwin":
  4985. OPTS += ['GL', 'OPT:2']
  4986. TargetAdd('p3dcert.exe', opts=OPTS)
  4987. #
  4988. # DIRECTORY: direct/src/plugin_npapi/
  4989. #
  4990. if RUNTIME:
  4991. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4992. if GetTarget() == 'windows':
  4993. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4994. "version" : VERSION,
  4995. "description" : "Runs 3-D games and interactive applets",
  4996. "filename" : "nppanda3d.dll",
  4997. "mimetype" : "application/x-panda3d",
  4998. "extension" : "p3d",
  4999. "filedesc" : "Panda3D applet"}
  5000. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5001. elif GetTarget() == 'darwin':
  5002. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5003. OPTS += ['GTK2']
  5004. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5005. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5006. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5007. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5008. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5009. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5010. if GetTarget() == 'windows':
  5011. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5012. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5013. elif GetTarget() == 'darwin':
  5014. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5015. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5016. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5017. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5018. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5019. #
  5020. # DIRECTORY: direct/src/plugin_activex/
  5021. #
  5022. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5023. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5024. DefSymbol('ACTIVEX', '_USRDLL', '')
  5025. DefSymbol('ACTIVEX', '_WINDLL', '')
  5026. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5027. DefSymbol('ACTIVEX', '_MBCS', '')
  5028. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5029. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5030. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5031. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5032. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5033. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5034. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5035. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5036. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5037. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5038. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5039. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5040. #
  5041. # DIRECTORY: direct/src/plugin_standalone/
  5042. #
  5043. if (RUNTIME):
  5044. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5045. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5046. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5047. if GetTarget() == 'windows':
  5048. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5049. "version" : VERSION,
  5050. "description" : "Runs 3-D games and interactive applets",
  5051. "filename" : "panda3d.exe",
  5052. "mimetype" : "application/x-panda3d",
  5053. "extension" : "p3d",
  5054. "filedesc" : "Panda3D applet",
  5055. "icon" : "panda3d.ico"}
  5056. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5057. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5058. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5059. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5060. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5061. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5062. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5063. if GetTarget() == 'darwin':
  5064. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5065. elif GetTarget() == 'windows':
  5066. TargetAdd('panda3d.exe', input='panda3d.res')
  5067. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5068. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5069. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5070. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5071. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5072. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5073. if (GetTarget() == 'darwin'):
  5074. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5075. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5076. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5077. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5078. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5079. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5080. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5081. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5082. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5083. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5084. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5085. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5086. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5087. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5088. elif (GetTarget() == 'windows'):
  5089. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5090. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5091. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5092. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5093. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5094. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5095. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5096. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5097. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5098. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5099. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5100. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5101. if (RTDIST):
  5102. 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']
  5103. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5104. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5105. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5106. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5107. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5108. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5109. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5110. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5111. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5112. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5113. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5114. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5115. if (GetTarget() == 'darwin'):
  5116. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5117. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5118. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5119. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5120. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5121. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5122. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5123. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5124. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5125. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5126. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5127. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5128. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5129. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5130. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5131. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5132. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5133. if GetTarget() == 'darwin':
  5134. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5135. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5136. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5137. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5138. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5139. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5140. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5141. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5142. if GetTarget() == 'darwin':
  5143. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5144. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5145. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5146. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5147. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5148. if GetTarget() == 'windows':
  5149. OPTS.append("P3DEMBEDW")
  5150. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5151. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5152. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5153. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5154. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5155. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5156. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5157. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5158. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5159. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5160. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5161. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5162. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5163. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5164. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5165. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5166. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5167. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5168. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5169. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5170. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5171. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5172. #
  5173. # DIRECTORY: pandatool/src/pandatoolbase/
  5174. #
  5175. if (PkgSkip("PANDATOOL")==0):
  5176. OPTS=['DIR:pandatool/src/pandatoolbase']
  5177. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5178. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5179. #
  5180. # DIRECTORY: pandatool/src/converter/
  5181. #
  5182. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5183. OPTS=['DIR:pandatool/src/converter']
  5184. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5185. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5186. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5187. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5188. #
  5189. # DIRECTORY: pandatool/src/progbase/
  5190. #
  5191. if not PkgSkip("PANDATOOL"):
  5192. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5193. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5194. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5195. #
  5196. # DIRECTORY: pandatool/src/eggbase/
  5197. #
  5198. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5199. OPTS=['DIR:pandatool/src/eggbase']
  5200. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5201. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5202. #
  5203. # DIRECTORY: pandatool/src/bam/
  5204. #
  5205. if not PkgSkip("PANDATOOL"):
  5206. OPTS=['DIR:pandatool/src/bam']
  5207. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5208. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5209. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5210. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5211. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5212. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5213. if not PkgSkip("EGG"):
  5214. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5215. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5216. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5217. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5218. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5219. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5220. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5221. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5222. #
  5223. # DIRECTORY: pandatool/src/cvscopy/
  5224. #
  5225. if not PkgSkip("PANDATOOL"):
  5226. OPTS=['DIR:pandatool/src/cvscopy']
  5227. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5228. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5229. #
  5230. # DIRECTORY: pandatool/src/daeegg/
  5231. #
  5232. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5233. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5234. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5235. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5236. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5237. #
  5238. # DIRECTORY: pandatool/src/assimp
  5239. #
  5240. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5241. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5242. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5243. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5244. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5245. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5246. #
  5247. # DIRECTORY: pandatool/src/daeprogs/
  5248. #
  5249. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5250. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5251. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5252. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5253. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5254. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5255. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5256. #
  5257. # DIRECTORY: pandatool/src/dxf/
  5258. #
  5259. if not PkgSkip("PANDATOOL"):
  5260. OPTS=['DIR:pandatool/src/dxf']
  5261. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5262. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5263. #
  5264. # DIRECTORY: pandatool/src/dxfegg/
  5265. #
  5266. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5267. OPTS=['DIR:pandatool/src/dxfegg']
  5268. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5269. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5270. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5271. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5272. #
  5273. # DIRECTORY: pandatool/src/dxfprogs/
  5274. #
  5275. if not PkgSkip("PANDATOOL"):
  5276. OPTS=['DIR:pandatool/src/dxfprogs']
  5277. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5278. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5279. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5280. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5281. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5282. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5283. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5284. if not PkgSkip("EGG"):
  5285. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5286. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5287. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5288. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5289. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5290. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5291. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5292. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5293. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5294. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5295. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5296. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5297. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5298. #
  5299. # DIRECTORY: pandatool/src/objegg/
  5300. #
  5301. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5302. OPTS=['DIR:pandatool/src/objegg']
  5303. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5304. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5305. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5306. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5307. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5308. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5309. #
  5310. # DIRECTORY: pandatool/src/objprogs/
  5311. #
  5312. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5313. OPTS=['DIR:pandatool/src/objprogs']
  5314. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5315. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5316. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5317. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5318. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5319. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5320. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5321. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5322. #
  5323. # DIRECTORY: pandatool/src/palettizer/
  5324. #
  5325. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5326. OPTS=['DIR:pandatool/src/palettizer']
  5327. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5328. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5329. #
  5330. # DIRECTORY: pandatool/src/egg-mkfont/
  5331. #
  5332. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5333. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5334. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5335. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5336. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5337. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5338. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5339. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5340. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5341. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5342. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5343. #
  5344. # DIRECTORY: pandatool/src/eggcharbase/
  5345. #
  5346. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5347. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5348. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5349. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5350. #
  5351. # DIRECTORY: pandatool/src/egg-optchar/
  5352. #
  5353. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5354. OPTS=['DIR:pandatool/src/egg-optchar']
  5355. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5356. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5357. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5358. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5359. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5360. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5361. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5362. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5363. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5364. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5365. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5366. #
  5367. # DIRECTORY: pandatool/src/egg-palettize/
  5368. #
  5369. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5370. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5371. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5372. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5373. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5374. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5375. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5376. #
  5377. # DIRECTORY: pandatool/src/egg-qtess/
  5378. #
  5379. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5380. OPTS=['DIR:pandatool/src/egg-qtess']
  5381. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5382. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5383. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5384. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5385. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5386. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5387. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5388. #
  5389. # DIRECTORY: pandatool/src/eggprogs/
  5390. #
  5391. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5392. OPTS=['DIR:pandatool/src/eggprogs']
  5393. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5394. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5395. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5396. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5397. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5398. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5399. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5400. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5401. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5402. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5403. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5404. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5405. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5406. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5407. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5408. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5409. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5410. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5411. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5412. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5413. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5414. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5415. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5416. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5417. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5418. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5419. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5420. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5421. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5422. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5423. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5424. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5425. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5426. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5427. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5428. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5429. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5430. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5431. #
  5432. # DIRECTORY: pandatool/src/flt/
  5433. #
  5434. if not PkgSkip("PANDATOOL"):
  5435. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5436. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5437. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5438. #
  5439. # DIRECTORY: pandatool/src/fltegg/
  5440. #
  5441. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5442. OPTS=['DIR:pandatool/src/fltegg']
  5443. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5444. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5445. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5446. #
  5447. # DIRECTORY: pandatool/src/fltprogs/
  5448. #
  5449. if not PkgSkip("PANDATOOL"):
  5450. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5451. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5452. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5453. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5454. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5455. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5456. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5457. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5458. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5459. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5460. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5461. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5462. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5463. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5464. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5465. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5466. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5467. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5468. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5469. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5470. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5471. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5472. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5473. if not PkgSkip("EGG"):
  5474. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5475. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5476. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5477. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5478. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5479. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5480. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5481. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5482. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5483. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5484. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5485. #
  5486. # DIRECTORY: pandatool/src/imagebase/
  5487. #
  5488. if not PkgSkip("PANDATOOL"):
  5489. OPTS=['DIR:pandatool/src/imagebase']
  5490. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5491. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5492. #
  5493. # DIRECTORY: pandatool/src/imageprogs/
  5494. #
  5495. if not PkgSkip("PANDATOOL"):
  5496. OPTS=['DIR:pandatool/src/imageprogs']
  5497. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5498. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5499. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5500. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5501. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5502. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5503. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5504. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5505. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5506. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5507. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5508. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5509. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5510. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5511. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5512. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5513. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5514. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5515. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5516. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5517. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5518. #
  5519. # DIRECTORY: pandatool/src/pfmprogs/
  5520. #
  5521. if not PkgSkip("PANDATOOL"):
  5522. OPTS=['DIR:pandatool/src/pfmprogs']
  5523. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5524. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5525. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5526. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5527. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5528. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5529. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5530. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5531. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5532. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5533. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5534. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5535. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5536. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5537. #
  5538. # DIRECTORY: pandatool/src/lwo/
  5539. #
  5540. if not PkgSkip("PANDATOOL"):
  5541. OPTS=['DIR:pandatool/src/lwo']
  5542. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5543. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5544. #
  5545. # DIRECTORY: pandatool/src/lwoegg/
  5546. #
  5547. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5548. OPTS=['DIR:pandatool/src/lwoegg']
  5549. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5550. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5551. #
  5552. # DIRECTORY: pandatool/src/lwoprogs/
  5553. #
  5554. if not PkgSkip("PANDATOOL"):
  5555. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5556. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5557. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5558. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5559. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5560. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5561. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5562. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5563. if not PkgSkip("EGG"):
  5564. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5565. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5566. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5567. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5568. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5569. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5570. #
  5571. # DIRECTORY: pandatool/src/maya/
  5572. #
  5573. for VER in MAYAVERSIONS:
  5574. VNUM=VER[4:]
  5575. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5576. OPTS=['DIR:pandatool/src/maya', VER]
  5577. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5578. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5579. #
  5580. # DIRECTORY: pandatool/src/mayaegg/
  5581. #
  5582. for VER in MAYAVERSIONS:
  5583. VNUM=VER[4:]
  5584. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5585. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5586. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5587. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5588. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5589. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5590. #
  5591. # DIRECTORY: pandatool/src/maxegg/
  5592. #
  5593. for VER in MAXVERSIONS:
  5594. VNUM=VER[3:]
  5595. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5596. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5597. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5598. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5599. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5600. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5601. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5602. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5603. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5604. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5605. #
  5606. # DIRECTORY: pandatool/src/maxprogs/
  5607. #
  5608. for VER in MAXVERSIONS:
  5609. VNUM=VER[3:]
  5610. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5611. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5612. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5613. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5614. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5615. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5616. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5617. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5618. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5619. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5620. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5621. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5622. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5623. #
  5624. # DIRECTORY: pandatool/src/vrml/
  5625. #
  5626. if not PkgSkip("PANDATOOL"):
  5627. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5628. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5629. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5630. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5631. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5632. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5633. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5634. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5635. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5636. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5637. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5638. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5639. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5640. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5641. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5642. #
  5643. # DIRECTORY: pandatool/src/vrmlegg/
  5644. #
  5645. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5646. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5647. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5648. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5649. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5650. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5651. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5652. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5653. #
  5654. # DIRECTORY: pandatool/src/xfile/
  5655. #
  5656. if not PkgSkip("PANDATOOL"):
  5657. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5658. CreateFile(GetOutputDir()+"/include/xParser.h")
  5659. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5660. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5661. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5662. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5663. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5664. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5665. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5666. #
  5667. # DIRECTORY: pandatool/src/xfileegg/
  5668. #
  5669. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5670. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5671. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5672. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5673. #
  5674. # DIRECTORY: pandatool/src/ptloader/
  5675. #
  5676. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5677. if not PkgSkip("FCOLLADA"):
  5678. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5679. 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']
  5680. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5681. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5682. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5683. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5684. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5685. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5686. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5687. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5688. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5689. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5690. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5691. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5692. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5693. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5694. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5695. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5696. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5697. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5698. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5699. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5700. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5701. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5702. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5703. #
  5704. # DIRECTORY: pandatool/src/miscprogs/
  5705. #
  5706. # This is a bit of an esoteric tool, and it causes issues because
  5707. # it conflicts with tools of the same name in different packages.
  5708. #if (PkgSkip("PANDATOOL")==0):
  5709. # OPTS=['DIR:pandatool/src/miscprogs']
  5710. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5711. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5712. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5713. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5714. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5715. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5716. #
  5717. # DIRECTORY: pandatool/src/pstatserver/
  5718. #
  5719. if (PkgSkip("PANDATOOL")==0):
  5720. OPTS=['DIR:pandatool/src/pstatserver']
  5721. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5722. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5723. #
  5724. # DIRECTORY: pandatool/src/text-stats/
  5725. #
  5726. if (PkgSkip("PANDATOOL")==0):
  5727. OPTS=['DIR:pandatool/src/text-stats']
  5728. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5729. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5730. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5731. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5732. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5733. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5734. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5735. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5736. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5737. #
  5738. # DIRECTORY: pandatool/src/vrmlprogs/
  5739. #
  5740. if not PkgSkip("PANDATOOL"):
  5741. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5742. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5743. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5744. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5745. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5746. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5747. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5748. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5749. if not PkgSkip("EGG"):
  5750. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5751. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5752. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5753. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5754. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5755. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5756. #
  5757. # DIRECTORY: pandatool/src/win-stats/
  5758. # DIRECTORY: pandatool/src/gtk-stats/
  5759. #
  5760. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5761. if GetTarget() == 'windows':
  5762. OPTS=['DIR:pandatool/src/win-stats']
  5763. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5764. else:
  5765. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5766. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5767. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5768. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5769. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5770. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5771. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5772. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5773. #
  5774. # DIRECTORY: pandatool/src/xfileprogs/
  5775. #
  5776. if not PkgSkip("PANDATOOL"):
  5777. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5778. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5779. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5780. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5781. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5782. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5783. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5784. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5785. if not PkgSkip("EGG"):
  5786. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5787. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5788. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5789. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5790. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5791. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5792. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5793. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5794. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5795. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5796. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5797. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5798. #
  5799. # DIRECTORY: pandatool/src/mayaprogs/
  5800. #
  5801. for VER in MAYAVERSIONS:
  5802. VNUM = VER[4:]
  5803. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5804. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5805. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5806. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5807. continue
  5808. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5809. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5810. elif GetTarget() == 'darwin':
  5811. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5812. else:
  5813. ARCH_OPTS = []
  5814. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5815. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5816. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5817. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5818. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5819. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5820. #if GetTarget() == 'windows':
  5821. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5822. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5823. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5824. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5825. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5826. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5827. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5828. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5829. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5830. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5831. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5832. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5833. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5834. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5835. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5836. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5837. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5838. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5839. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5840. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5841. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5842. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5843. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5844. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5845. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5846. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5847. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5848. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5849. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5850. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5851. if GetTarget() == 'windows':
  5852. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5853. else:
  5854. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5855. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5856. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5857. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5858. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5859. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5860. if GetTarget() == 'windows':
  5861. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5862. else:
  5863. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5864. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5865. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5866. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5867. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5868. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5869. if GetTarget() == 'windows':
  5870. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5871. else:
  5872. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5873. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5874. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5875. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5876. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5877. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5878. if GetTarget() == 'windows':
  5879. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5880. else:
  5881. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5882. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5883. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5884. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5885. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5886. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5887. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5888. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5889. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5890. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5891. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5892. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5893. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5894. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5895. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5896. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5897. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5898. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5899. #
  5900. # DIRECTORY: contrib/src/ai/
  5901. #
  5902. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5903. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5904. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5905. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5906. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5907. OPTS=['DIR:contrib/src/ai']
  5908. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5909. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5910. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5911. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5912. PyTargetAdd('ai_module.obj', opts=OPTS)
  5913. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5914. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5915. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5916. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5917. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5918. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5919. #
  5920. # DIRECTORY: contrib/src/rplight/
  5921. #
  5922. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5923. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5924. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5925. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5926. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5927. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5928. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5929. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5930. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5931. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5932. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5933. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5934. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5935. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5936. #
  5937. # DIRECTORY: pandatool/src/deploy-stub
  5938. #
  5939. if PkgSkip("PYTHON") == 0:
  5940. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5941. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5942. if GetTarget() == 'windows':
  5943. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5944. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5945. # Setup rpath so libs can be found in the same directory as the deployed game
  5946. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5947. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5948. LibName('DEPLOYSTUB', "-rdynamic")
  5949. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5950. if GetTarget() == 'windows':
  5951. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5952. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5953. if GetTarget() == 'windows':
  5954. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5955. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5956. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5957. elif GetTarget() == 'darwin':
  5958. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5959. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5960. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5961. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5962. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5963. #
  5964. # Generate the models directory and samples directory
  5965. #
  5966. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5967. model_extensions = ["*.egg"]
  5968. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5969. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5970. model_extensions.append("*.flt")
  5971. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5972. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5973. newname = model[:-4] + ".egg.pz"
  5974. else:
  5975. newname = model[:-4] + ".egg"
  5976. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5977. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5978. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5979. newname = model[:-4] + ".egg.pz"
  5980. else:
  5981. newname = model[:-4] + ".egg"
  5982. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5983. for model in GetDirectoryContents("models", model_extensions):
  5984. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5985. newname = model[:-4] + ".egg.pz"
  5986. else:
  5987. newname = model[:-4] + ".egg"
  5988. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5989. if not PkgSkip("DIRECT") and not RUNTIME:
  5990. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5991. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5992. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5993. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5994. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5995. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5996. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5997. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5998. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5999. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6000. #
  6001. # Build the rtdist.
  6002. #
  6003. if (RTDIST):
  6004. OPTS=['DIR:direct/src/p3d']
  6005. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6006. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6007. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6008. #
  6009. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6010. #
  6011. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6012. OPTS=['DIR:direct/src/p3d']
  6013. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6014. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6015. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6016. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6017. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6018. ##########################################################################################
  6019. #
  6020. # Dependency-Based Distributed Build System.
  6021. #
  6022. ##########################################################################################
  6023. DEPENDENCYQUEUE=[]
  6024. for target in TARGET_LIST:
  6025. name = target.name
  6026. inputs = target.inputs
  6027. opts = target.opts
  6028. deps = target.deps
  6029. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6030. def BuildWorker(taskqueue, donequeue):
  6031. while True:
  6032. try:
  6033. task = taskqueue.get(timeout=1)
  6034. except:
  6035. ProgressOutput(None, "Waiting for tasks...")
  6036. task = taskqueue.get()
  6037. sys.stdout.flush()
  6038. if (task == 0): return
  6039. try:
  6040. task[0](*task[1])
  6041. donequeue.put(task)
  6042. except:
  6043. donequeue.put(0)
  6044. def AllSourcesReady(task, pending):
  6045. sources = task[3]
  6046. for x in sources:
  6047. if (x in pending):
  6048. return 0
  6049. sources = task[1][1]
  6050. for x in sources:
  6051. if (x in pending):
  6052. return 0
  6053. altsources = task[4]
  6054. for x in altsources:
  6055. if (x in pending):
  6056. return 0
  6057. return 1
  6058. def ParallelMake(tasklist):
  6059. # Create the communication queues.
  6060. donequeue = queue.Queue()
  6061. taskqueue = queue.Queue()
  6062. # Build up a table listing all the pending targets
  6063. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6064. # task[2] = [name]
  6065. # task[3] = deps
  6066. # The python tool package, in particular fltegg seems to throw parallelmake off
  6067. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6068. # and another subpart to be built sequentially. The most time consuming part of the process
  6069. # is the c++ code generation anyways.
  6070. tasklist_seq = []
  6071. i = 0
  6072. while i < len(tasklist):
  6073. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6074. break
  6075. i += 1
  6076. if i < len(tasklist):
  6077. tasklist_seq = tasklist[i:]
  6078. tasklist = tasklist[:i]
  6079. iNumStartingTasks = len(tasklist)
  6080. pending = {}
  6081. for task in tasklist:
  6082. for target in task[2]:
  6083. pending[target] = 1
  6084. # Create the workers
  6085. for slave in range(THREADCOUNT):
  6086. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6087. th.setDaemon(1)
  6088. th.start()
  6089. # Feed tasks to the workers.
  6090. tasksqueued = 0
  6091. while True:
  6092. if (tasksqueued < THREADCOUNT):
  6093. extras = []
  6094. for task in tasklist:
  6095. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6096. if (NeedsBuild(task[2], task[3])):
  6097. tasksqueued += 1
  6098. taskqueue.put(task)
  6099. else:
  6100. for target in task[2]:
  6101. del pending[target]
  6102. else:
  6103. extras.append(task)
  6104. tasklist = extras
  6105. sys.stdout.flush()
  6106. if (tasksqueued == 0): break
  6107. donetask = donequeue.get()
  6108. if (donetask == 0):
  6109. exit("Build process aborting.")
  6110. sys.stdout.flush()
  6111. tasksqueued -= 1
  6112. JustBuilt(donetask[2], donetask[3])
  6113. for target in donetask[2]:
  6114. del pending[target]
  6115. # Kill the workers.
  6116. for slave in range(THREADCOUNT):
  6117. taskqueue.put(0)
  6118. # Make sure there aren't any unsatisfied tasks
  6119. if len(tasklist) > 0:
  6120. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6121. SequentialMake(tasklist_seq)
  6122. def SequentialMake(tasklist):
  6123. i = 0
  6124. for task in tasklist:
  6125. if (NeedsBuild(task[2], task[3])):
  6126. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6127. JustBuilt(task[2], task[3])
  6128. i += 1
  6129. def RunDependencyQueue(tasklist):
  6130. if (THREADCOUNT!=0):
  6131. ParallelMake(tasklist)
  6132. else:
  6133. SequentialMake(tasklist)
  6134. try:
  6135. RunDependencyQueue(DEPENDENCYQUEUE)
  6136. finally:
  6137. SaveDependencyCache()
  6138. # Run the test suite.
  6139. if RUNTESTS:
  6140. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6141. if sys.version_info >= (2, 6):
  6142. cmdstr += " -B"
  6143. cmdstr += " -m pytest tests"
  6144. if GetVerbose():
  6145. cmdstr += " --verbose"
  6146. oscmd(cmdstr)
  6147. # Write out information about the Python versions in the built dir.
  6148. python_version_info = GetCurrentPythonVersionInfo()
  6149. UpdatePythonVersionInfoFile(python_version_info)
  6150. ##########################################################################################
  6151. #
  6152. # The Installers
  6153. #
  6154. # Under windows, we can build an 'exe' package using NSIS
  6155. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6156. # Under OSX, we can make a 'dmg' package.
  6157. #
  6158. ##########################################################################################
  6159. if INSTALLER:
  6160. ProgressOutput(100.0, "Building installer")
  6161. from makepackage import MakeInstaller
  6162. # When using the --installer flag, only install for the current version.
  6163. python_versions = []
  6164. if python_version_info:
  6165. python_versions.append(python_version_info)
  6166. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6167. optimize=GetOptimize(), compressor=COMPRESSOR,
  6168. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  6169. runtime=RUNTIME, python_versions=python_versions)
  6170. if WHEEL:
  6171. ProgressOutput(100.0, "Building wheel")
  6172. from makewheel import makewheel
  6173. makewheel(WHLVERSION, GetOutputDir())
  6174. ##########################################################################################
  6175. #
  6176. # Print final status report.
  6177. #
  6178. ##########################################################################################
  6179. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6180. printStatus("Makepanda Final Status Report", WARNINGS)
  6181. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())