makepanda.py 261 KB

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