diff --git a/doc/makepanda/makepanda.py b/doc/makepanda/makepanda.py index 9defbfbfec..cc48d4e303 100755 --- a/doc/makepanda/makepanda.py +++ b/doc/makepanda/makepanda.py @@ -317,6 +317,12 @@ if (COMPILER=="LINUX"): WARNINGS.append("I have automatically added this command-line option: --no-"+pkg.lower()) PkgDisable(pkg) + for pkg in MAYAVERSIONS: + if (PkgSkip(pkg)==0): + LibDirectory(pkg, SDK[pkg] + '/lib') + IncDirectory(pkg, SDK[pkg] + "/include") + DefSymbol(pkg, "MAYAVERSION", pkg) + if (sys.platform == "darwin"): if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", "-framework Cg") if (PkgSkip("OPENAL")==0): LibName("OPENAL", "-framework OpenAL") @@ -351,17 +357,43 @@ if (COMPILER=="LINUX"): if (PkgSkip("OPENCV")==0): LibName("OPENCV", "-lhighgui") if (PkgSkip("OPENCV")==0): LibName("OPENCV", "-lml") if (sys.platform == "darwin"): - if (PkgSkip("OPENCV")==0): LibName("OPENCV", "-framework QuickTime") - LibName("AGL", "-framework AGL") - LibName("CARBON", "-framework Carbon") - LibName("COCOA", "-framework Cocoa") - LibName("GLUT", "-framework OpenGL") - LibName("GLUT", "-lOSMesa") - # Fix for a bug in OSX: - LibName("GLUT", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") + if (PkgSkip("OPENCV")==0): LibName("OPENCV", "-framework QuickTime") + LibName("AGL", "-framework AGL") + LibName("CARBON", "-framework Carbon") + LibName("COCOA", "-framework Cocoa") + LibName("GLUT", "-framework OpenGL") + LibName("GLUT", "-lOSMesa") + # Fix for a bug in OSX: + LibName("GLUT", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") else: - LibName("GLUT", "-lGL") - LibName("GLUT", "-lGLU") + LibName("GLUT", "-lGL") + LibName("GLUT", "-lGLU") + + for pkg in MAYAVERSIONS: + if (PkgSkip(pkg)==0): + LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib") + LibName(pkg, "-lOpenMayalib") + LibName(pkg, "-lOpenMaya") + LibName(pkg, "-lOpenMayaAnim") + LibName(pkg, "-lAnimSlice") + LibName(pkg, "-lDeformSlice") + LibName(pkg, "-lModifiers") + LibName(pkg, "-lDynSlice") + LibName(pkg, "-lKinSlice") + LibName(pkg, "-lModelSlice") + LibName(pkg, "-lNurbsSlice") + LibName(pkg, "-lPolySlice") + LibName(pkg, "-lProjectSlice") + LibName(pkg, "-lImage") + LibName(pkg, "-lShared") + LibName(pkg, "-lTranslators") + LibName(pkg, "-lDataModel") + LibName(pkg, "-lRenderModel") + LibName(pkg, "-lNurbsEngine") + LibName(pkg, "-lDependEngine") + LibName(pkg, "-lCommandEngine") + LibName(pkg, "-lFoundation") + LibName(pkg, "-lIMFbase") DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1") IncDirectory("ALWAYS", "built/tmp") @@ -3166,33 +3198,37 @@ for VER in MAYAVERSIONS: TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll') TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS_PYSTUB) TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]) - + + # Temporary fix, until I get mayaWrapper.cxx working on non-windows systems. + if (sys.platform=="win32"): suffix = "-wrapped" + else: suffix = "" + TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx') - TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj') - TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='libmayaegg'+VNUM+'.lib') - TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='libmaya'+VNUM+'.lib') - TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS_PYSTUB) - TargetAdd('maya2egg'+VNUM+'-wrapped.exe', opts=['ADVAPI', VER]) - + TargetAdd('maya2egg'+VNUM+suffix+'.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj') + TargetAdd('maya2egg'+VNUM+suffix+'.exe', input='libmayaegg'+VNUM+'.lib') + TargetAdd('maya2egg'+VNUM+suffix+'.exe', input='libmaya'+VNUM+'.lib') + TargetAdd('maya2egg'+VNUM+suffix+'.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('maya2egg'+VNUM+suffix+'.exe', opts=['ADVAPI', VER]) + TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx') - TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='mayacopy'+VNUM+'_mayaCopy.obj') - TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='libcvscopy.lib') - TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='libmaya'+VNUM+'.lib') - TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS_PYSTUB) - TargetAdd('mayacopy'+VNUM+'-wrapped.exe', opts=['ADVAPI', VER]) - + TargetAdd('mayacopy'+VNUM+suffix+'.exe', input='mayacopy'+VNUM+'_mayaCopy.obj') + TargetAdd('mayacopy'+VNUM+suffix+'.exe', input='libcvscopy.lib') + TargetAdd('mayacopy'+VNUM+suffix+'.exe', input='libmaya'+VNUM+'.lib') + TargetAdd('mayacopy'+VNUM+suffix+'.exe', input=COMMON_EGG2X_LIBS_PYSTUB) + TargetAdd('mayacopy'+VNUM+suffix+'.exe', opts=['ADVAPI', VER]) + TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx') TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj') TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]) - - TargetAdd('mayaWrapper'+VNUM+'.obj', opts=OPTS, input='mayaWrapper.cxx') - - TargetAdd('maya2egg'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj') - TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']) - - TargetAdd('mayacopy'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj') - TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']) - + + if (sys.platform=="win32"): + TargetAdd('mayaWrapper'+VNUM+'.obj', opts=OPTS, input='mayaWrapper.cxx') + + TargetAdd('maya2egg'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj') + TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']) + + TargetAdd('mayacopy'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj') + TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']) # @@ -3553,12 +3589,7 @@ def MakeInstallerLinux(): import compileall PYTHONV=SDK["PYTHONVERSION"] if (os.path.isdir("linuxroot")): oscmd("chmod -R 755 linuxroot") - if (os.path.exists("/usr/bin/dpkg-deb")): - oscmd("dpkg --print-architecture > built/tmp/architecture.txt") - if (os.path.exists("/usr/bin/rpmbuild")): - oscmd("rpm -E '%_target_cpu' > built/tmp/architecture.txt") - ARCH=ReadFile("built/tmp/architecture.txt").strip() - oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec "+ARCH) + oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec `dpkg --print-architecture` `rpm -E '%_target_cpu'`") oscmd("mkdir -p linuxroot/usr/bin") oscmd("mkdir -p linuxroot/usr/include") oscmd("mkdir -p linuxroot/usr/share/panda3d") @@ -3573,8 +3604,9 @@ def MakeInstallerLinux(): oscmd("cp --recursive built/pandac linuxroot/usr/share/panda3d/pandac") oscmd("cp built/direct/__init__.py linuxroot/usr/share/panda3d/direct/__init__.py") oscmd("cp --recursive built/models linuxroot/usr/share/panda3d/models") - if (os.path.isdir("built/Pmw")): oscmd("cp --recursive built/Pmw linuxroot/usr/share/panda3d/Pmw") - if (os.path.isdir("samples")): oscmd("cp --recursive samples linuxroot/usr/share/panda3d/samples") + if os.path.isdir("samples"): oscmd("cp --recursive samples linuxroot/usr/share/panda3d/samples") + if os.path.isdir("built/Pmw"): oscmd("cp --recursive built/Pmw linuxroot/usr/share/panda3d/Pmw") + if os.path.isdir("built/plugins"): oscmd("cp --recursive built/plugins linuxroot/usr/share/panda3d/plugins") oscmd("cp doc/LICENSE linuxroot/usr/share/panda3d/LICENSE") oscmd("cp doc/LICENSE linuxroot/usr/include/panda3d/LICENSE") oscmd("cp doc/ReleaseNotes linuxroot/usr/share/panda3d/ReleaseNotes") @@ -3590,9 +3622,20 @@ def MakeInstallerLinux(): compileall.compile_dir("linuxroot/usr/share/panda3d/Pmw") DeleteCVS("linuxroot") oscmd("chmod -R 555 linuxroot/usr/share/panda3d") - oscmd("chmod -R 444 linuxroot/usr/share/panda3d/models") - + + if (os.path.exists("/usr/bin/rpmbuild")): + oscmd("rm -rf linuxroot/DEBIAN") + oscmd("rpm -E '%_target_cpu' > built/tmp/architecture.txt") + ARCH=ReadFile("built/tmp/architecture.txt").strip() + pandasource = os.path.abspath(os.getcwd()) + txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",VERSION).replace("PANDASOURCE",pandasource) + WriteFile("panda3d.spec", txt) + oscmd("rpmbuild --define '_rpmdir "+pandasource+"' -bb panda3d.spec") + oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-1."+ARCH+".rpm .") + if (os.path.exists("/usr/bin/dpkg-deb")): + oscmd("dpkg --print-architecture > built/tmp/architecture.txt") + ARCH=ReadFile("built/tmp/architecture.txt").strip() txt = INSTALLER_DEB_FILE[1:].replace("VERSION",str(VERSION)).replace("PYTHONV",PYTHONV).replace("ARCH",ARCH) oscmd("mkdir -p linuxroot/DEBIAN") oscmd("cd linuxroot ; (find usr -type f -exec md5sum {} \;) > DEBIAN/md5sums") @@ -3604,13 +3647,6 @@ def MakeInstallerLinux(): oscmd("cp linuxroot/DEBIAN/postinst linuxroot/DEBIAN/postrm") oscmd("dpkg-deb -b linuxroot panda3d_"+VERSION+"_"+ARCH+".deb") oscmd("chmod -R 755 linuxroot") - - if (os.path.exists("/usr/bin/rpmbuild")): - pandasource = os.path.abspath(os.getcwd()) - txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",VERSION).replace("PANDASOURCE",pandasource) - WriteFile("panda3d.spec", txt) - oscmd("rpmbuild --define '_rpmdir "+pandasource+"' -bb panda3d.spec") - oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-1."+ARCH+".rpm .") if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")): exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!") @@ -3650,8 +3686,9 @@ def MakeInstallerOSX(): oscmd("cp -R doc/LICENSE Panda3D-tpl-rw/Panda3D/%s/LICENSE" % VERSION) oscmd("cp -R doc/ReleaseNotes Panda3D-tpl-rw/Panda3D/%s/ReleaseNotes" % VERSION) oscmd("cp -R built/bin/* Panda3D-tpl-rw/Panda3D/%s/bin/" % VERSION) - if os.path.isdir("samples"): oscmd("cp -R samples Panda3D-tpl-rw/Panda3D/%s/samples" % VERSION) - if os.path.isdir("built/Pmw"): oscmd("cp -R built/Pmw Panda3D-tpl-rw/Panda3D/%s/lib/Pmw" % VERSION) + if os.path.isdir("samples"): oscmd("cp -R samples Panda3D-tpl-rw/Panda3D/%s/samples" % VERSION) + if os.path.isdir("built/Pmw"): oscmd("cp -R built/Pmw Panda3D-tpl-rw/Panda3D/%s/lib/Pmw" % VERSION) + if os.path.isdir("built/plugins"): oscmd("cp -R built/plugins Panda3D-tpl-rw/Panda3D/%s/plugins" % VERSION) for base in os.listdir("built/lib"): oscmd("cp built/lib/"+base+" Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/"+base) for base in os.listdir("Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/direct/src"): @@ -3660,7 +3697,7 @@ def MakeInstallerOSX(): compileall.compile_dir("Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/Pmw") oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/direct") oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/pandac") - oscmd("chmod -R 444 Panda3D-tpl-rw/Panda3D/"+VERSION+"/models") + oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/models") if os.path.isdir("samples"): oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/samples") if os.path.isdir("built/Pmw"): oscmd("chmod -R 555 Panda3D-tpl-rw/Panda3D/"+VERSION+"/lib/Pmw") except: # Make sure the dmg gets unmounted even when error occurs diff --git a/doc/makepanda/makepandacore.py b/doc/makepanda/makepandacore.py index e3edc224e1..05f5711413 100644 --- a/doc/makepanda/makepandacore.py +++ b/doc/makepanda/makepandacore.py @@ -9,7 +9,7 @@ ## ######################################################################## -import sys,os,time,stat,string,re,getopt,cPickle,fnmatch,threading,Queue,signal,shutil +import sys,os,time,stat,string,re,getopt,cPickle,fnmatch,threading,Queue,signal,shutil,platform SUFFIX_INC=[".cxx",".c",".h",".I",".yxx",".lxx",".mm"] SUFFIX_DLL=[".dll",".dlo",".dle",".dli",".dlm",".mll",".exe"] @@ -658,10 +658,9 @@ def SdkLocateDirectX(): SDK["DIRECTCAM"] = SDK["DX9"] def SdkLocateMaya(): - if (sys.platform != "win32"): return for (ver,key) in MAYAVERSIONINFO: - if (PkgSkip(ver)==0): - if (SDK.has_key(ver)==0): + if (PkgSkip(ver)==0 and SDK.has_key(ver)==0): + if (sys.platform == "win32"): ddir = "sdks/"+ver.lower().replace("x","") if (os.path.isdir(ddir)): SDK[ver] = ddir @@ -672,6 +671,32 @@ def SdkLocateMaya(): if (res != 0): res = res.replace("\\", "/").rstrip("/") SDK[res] = ver + elif (sys.platform == "darwin"): + ddir1 = "sdks/"+ver.lower().replace("x","")+"-osx" + if os.environ.has_key("MAYA_LOCATION"): ddir2 = os.environ["MAYA_LOCATION"].rstrip("/") + ddir3 = "/Applications/Autodesk/maya"+key+"/Maya.app/Contents" + if (os.path.isdir(ddir1)): + SDK[ver] = ddir1 + elif (os.environ.has_key("MAYA_LOCATION") and os.path.isdir(ddir2)): + SDK[ver] = ddir2 + elif (os.path.isdir(ddir3)): + SDK[ver] = ddir3 + else: + ddir1 = "sdks/"+ver.lower().replace("x","")+"-linux"+platform.architecture()[0].replace("bit","") + if os.environ.has_key("MAYA_LOCATION"): ddir2 = os.environ["MAYA_LOCATION"].rstrip("/") + if (platform.architecture()[0] == "64bit"): + ddir3 = "/usr/autodesk/maya"+key+"-x64" + else: + ddir3 = "/usr/autodesk/maya"+key + ddir4 = "/usr/autodesk/maya" + if (os.path.isdir(ddir1)): + SDK[ver] = ddir1 + elif (os.environ.has_key("MAYA_LOCATION") and os.path.isdir(ddir2)): + SDK[ver] = ddir2 + elif (os.path.isdir(ddir3)): + SDK[ver] = ddir3 + elif (os.path.isdir(ddir4)): + SDK[ver] = ddir4 def SdkLocateMax(): if (sys.platform != "win32"): return @@ -753,7 +778,10 @@ def SdkAutoDisableDirectX(): for ver in ["DX8","DX9","DIRECTCAM"]: if (PkgSkip(ver)==0): if (SDK.has_key(ver)==0): - WARNINGS.append("I cannot locate SDK for "+ver) + if (sys.platform == "win32"): + WARNINGS.append("I cannot locate SDK for "+ver) + else: + WARNINGS.append(ver+" only supported on windows yet") WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower()) PkgDisable(ver) else: @@ -764,10 +792,9 @@ def SdkAutoDisableMaya(): if (SDK.has_key(ver)==0) and (PkgSkip(ver)==0): if (sys.platform == "win32"): WARNINGS.append("The registry does not appear to contain a pointer to the "+ver+" SDK.") - WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower()) else: - WARNINGS.append(ver+" not yet supported under linux") - WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower()) + WARNINGS.append("I cannot locate SDK for "+ver) + WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower()) PkgDisable(ver) def SdkAutoDisableMax(): @@ -776,13 +803,11 @@ def SdkAutoDisableMax(): if (sys.platform == "win32"): if (SDK.has_key(version)): WARNINGS.append("Your copy of "+version+" does not include the character studio SDK") - WARNINGS.append("I have automatically added this command-line option: --no-"+version.lower()) - else: + else: WARNINGS.append("The registry does not appear to contain a pointer to "+version) - WARNINGS.append("I have automatically added this command-line option: --no-"+version.lower()) else: - WARNINGS.append(version+" not yet supported under linux") - WARNINGS.append("I have automatically added this command-line option: --no-"+version.lower()) + WARNINGS.append(version+" only supported on windows yet") + WARNINGS.append("I have automatically added this command-line option: --no-"+version.lower()) PkgDisable(version) ######################################################################## @@ -946,6 +971,7 @@ def CalcLocation(fn, ipath): if (fn.endswith(".c")): return CxxFindSource(fn, ipath) if (fn.endswith(".yxx")): return CxxFindSource(fn, ipath) if (fn.endswith(".lxx")): return CxxFindSource(fn, ipath) + if (fn.endswith(".mll")): return "built/plugins/"+fn if (sys.platform == "win32"): if (fn.endswith(".def")): return CxxFindSource(fn, ipath) if (fn.endswith(".obj")): return "built/tmp/"+fn @@ -953,7 +979,6 @@ def CalcLocation(fn, ipath): if (fn.endswith(".dlo")): return "built/plugins/"+fn if (fn.endswith(".dli")): return "built/plugins/"+fn if (fn.endswith(".dle")): return "built/plugins/"+fn - if (fn.endswith(".mll")): return "built/plugins/"+fn if (fn.endswith(".exe")): return "built/bin/"+fn if (fn.endswith(".lib")): return "built/lib/"+fn if (fn.endswith(".ilb")): return "built/tmp/"+fn[:-4]+".lib"