mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
some minor fixes
This commit is contained in:
parent
3e2f301fb7
commit
bf417aca6b
@ -100,7 +100,7 @@
|
|||||||
interrogatedb:c dconfig:c dtoolconfig:m \
|
interrogatedb:c dconfig:c dtoolconfig:m \
|
||||||
express:c pandaexpress:m \
|
express:c pandaexpress:m \
|
||||||
prc:c pstatclient:c pandabase:c linmath:c putil:c \
|
prc:c pstatclient:c pandabase:c linmath:c putil:c \
|
||||||
pipeline:c event:c nativenet:c panda:m
|
pipeline:c event:c nativenet:c net:c panda:m
|
||||||
|
|
||||||
#define SOURCES \
|
#define SOURCES \
|
||||||
binaryXml.cxx binaryXml.h \
|
binaryXml.cxx binaryXml.h \
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
// Mac-specific options.
|
// Mac-specific options.
|
||||||
#if $[OSX_PLATFORM]
|
#if $[OSX_PLATFORM]
|
||||||
#define LINK_AS_BUNDLE 1
|
#define LINK_AS_BUNDLE 1
|
||||||
|
#define BUNDLE_EXT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INSTALL_HEADERS
|
#define INSTALL_HEADERS
|
||||||
|
@ -110,7 +110,7 @@ def makeBundle(startDir):
|
|||||||
f.write(ResourceFile)
|
f.write(ResourceFile)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
os.system('/Developer/usr/bin/Rez -useDF -o %s %s' % (
|
os.system('/Developer/Tools/Rez -useDF -o %s %s' % (
|
||||||
resourceFilename.toOsSpecific(), tfile.toOsSpecific()))
|
resourceFilename.toOsSpecific(), tfile.toOsSpecific()))
|
||||||
tfile.unlink()
|
tfile.unlink()
|
||||||
|
|
||||||
|
@ -337,54 +337,61 @@ stream_as_file(NPStream *stream, const char *fname) {
|
|||||||
// "Macintosh HD:blah:blah:blah" instead of the new-style form
|
// "Macintosh HD:blah:blah:blah" instead of the new-style form
|
||||||
// "/blah/blah/blah". How annoying.
|
// "/blah/blah/blah". How annoying.
|
||||||
|
|
||||||
// TODO: Is "Macintosh HD:" the only possible prefix?
|
size_t colon = filename.find(':');
|
||||||
if (filename.substr(0, 13) == "Macintosh HD:") {
|
size_t slash = filename.find('/');
|
||||||
string fname2;
|
if (colon < slash) {
|
||||||
for (size_t p = 12; p < filename.size(); ++p) {
|
// This might be such a filename.
|
||||||
|
|
||||||
|
string fname2 = "/Volumes/";
|
||||||
|
for (size_t p = 0; p < filename.size(); ++p) {
|
||||||
if (filename[p] == ':') {
|
if (filename[p] == ':') {
|
||||||
fname2 += '/';
|
fname2 += '/';
|
||||||
} else {
|
} else {
|
||||||
fname2 += filename[p];
|
fname2 += filename[p];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filename = fname2;
|
|
||||||
|
|
||||||
// Here's another temporary hack. In addition to the weird
|
if (access(fname2.c_str(), R_OK) == 0) {
|
||||||
// filename format, the file that Safari tells us about appears to
|
// Looks like we've converted it successfully.
|
||||||
// be a temporary file that Safari's about to delete. In order to
|
filename = fname2;
|
||||||
// protect ourselves from this, we need to temporarily copy the
|
|
||||||
// file somewhere else.
|
|
||||||
char *name = tempnam(NULL, "p3d_");
|
|
||||||
|
|
||||||
// We prefer just making a hard link; it's quick and easy.
|
// Here's another temporary hack. In addition to the weird
|
||||||
if (link(filename.c_str(), name) == 0) {
|
// filename format, the file that Safari tells us about appears
|
||||||
logfile << "linked " << filename << " to " << name << "\n";
|
// to be a temporary file that Safari's about to delete. In
|
||||||
} else {
|
// order to protect ourselves from this, we need to temporarily
|
||||||
// But sometimes the hard link might fail, particularly if these
|
// copy the file somewhere else.
|
||||||
// are two different file systems. In this case we have to open
|
char *name = tempnam(NULL, "p3d_");
|
||||||
// the files and copy the data by hand.
|
|
||||||
ifstream in(filename.c_str(), ios::in | ios::binary);
|
|
||||||
ofstream out(name, ios::out | ios::binary);
|
|
||||||
|
|
||||||
static const size_t buffer_size = 4096;
|
// We prefer just making a hard link; it's quick and easy.
|
||||||
char buffer[buffer_size];
|
if (link(filename.c_str(), name) == 0) {
|
||||||
|
logfile << "linked " << filename << " to " << name << "\n";
|
||||||
in.read(buffer, buffer_size);
|
} else {
|
||||||
size_t count = in.gcount();
|
// But sometimes the hard link might fail, particularly if these
|
||||||
while (count != 0) {
|
// are two different file systems. In this case we have to open
|
||||||
out.write(buffer, count);
|
// the files and copy the data by hand.
|
||||||
|
ifstream in(filename.c_str(), ios::in | ios::binary);
|
||||||
|
ofstream out(name, ios::out | ios::binary);
|
||||||
|
|
||||||
|
static const size_t buffer_size = 4096;
|
||||||
|
char buffer[buffer_size];
|
||||||
|
|
||||||
in.read(buffer, buffer_size);
|
in.read(buffer, buffer_size);
|
||||||
count = in.gcount();
|
size_t count = in.gcount();
|
||||||
|
while (count != 0) {
|
||||||
|
out.write(buffer, count);
|
||||||
|
in.read(buffer, buffer_size);
|
||||||
|
count = in.gcount();
|
||||||
|
}
|
||||||
|
logfile << "copied " << filename << " to " << name << "\n";
|
||||||
}
|
}
|
||||||
logfile << "copied " << filename << " to " << name << "\n";
|
|
||||||
|
filename = name;
|
||||||
|
free(name);
|
||||||
|
|
||||||
|
// TODO: remove this temporary file when we're done with it.
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = name;
|
|
||||||
free(name);
|
|
||||||
|
|
||||||
// TODO: remove this temporary file when we're done with it.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
PPDownloadRequest *req = (PPDownloadRequest *)(stream->notifyData);
|
PPDownloadRequest *req = (PPDownloadRequest *)(stream->notifyData);
|
||||||
|
@ -55,12 +55,13 @@ if sys.platform == 'win32':
|
|||||||
|
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
# OSX
|
# OSX
|
||||||
|
compileObj = "gcc -fPIC -c -o %(basename)s.o -O2 -I%(pythonIPath)s %(filename)s"
|
||||||
PythonIPath = '/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5'
|
|
||||||
|
|
||||||
compileObj = "gcc -fPIC -c -o %(basename)s.o -O2 -arch i386 -arch ppc -I %(pythonIPath)s %(filename)s"
|
|
||||||
linkExe = "gcc -o %(basename)s %(basename)s.o -framework Python"
|
linkExe = "gcc -o %(basename)s %(basename)s.o -framework Python"
|
||||||
linkDll = "gcc -dynamiclib -o %(basename)s.so %(basename)s.o -framework Python"
|
linkDll = "gcc -undefined dynamic_lookup -bundle -o %(basename)s.so %(basename)s.o -framework Python"
|
||||||
|
#PythonLPath = '/Users/drose/player/osxtools/built/lib'
|
||||||
|
#PythonVersion = '2.4_panda'
|
||||||
|
#linkExe = "gcc -o %(basename)s %(basename)s.o -lpython%(pythonVersion)s -L%(pythonLPath)s"
|
||||||
|
#linkDll = "gcc -undefined dynamic_lookup -bundle -o %(basename)s.so %(basename)s.o -lpython%(pythonVersion)s -L%(pythonLPath)s"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Linux
|
# Linux
|
||||||
|
Loading…
x
Reference in New Issue
Block a user