makepanda.py 300 KB

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