makepanda.py 290 KB

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