makepanda.py 262 KB

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