makepanda.py 290 KB

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