More about ABI compatibility:

* Fixed the bug on non-Windows where the incorrect libraries are located
 * OSX dylibs now have compatibility_version and current_version set
This commit is contained in:
rdb 2010-03-14 11:48:08 +00:00
parent b89595c845
commit d668a53639
3 changed files with 14 additions and 5 deletions

View File

@ -468,7 +468,7 @@ read_args() {
char buffer[buffer_size];
DWORD size = GetModuleFileName(dllhandle, buffer, buffer_size);
if (size != 0) {
Filename tmp = Filename::from_os_specific(string(buffer,size));
Filename tmp = Filename::from_os_specific(string(buffer, size));
tmp.make_true_case();
_dtool_name = tmp;
}
@ -487,11 +487,11 @@ read_args() {
char buffer[PATH_MAX];
buffer[0] = 0;
maps.getline(buffer, PATH_MAX);
char *tail = strrchr(buffer,'/');
char *head = strchr(buffer,'/');
if (tail && head && (strcmp(tail,"/libp3dtool.so." PANDA_VERSION_STR)==0)) {
char *tail = strrchr(buffer, '/');
char *head = strchr(buffer, '/');
if (tail && head && (strcmp(tail, "/libp3dtool.so." PANDA_ABI_VERSION_STR) == 0)) {
_dtool_name = head;
} else if (tail && head && (strcmp(tail,"/libp3dtool.so")==0)) {
} else if (tail && head && (strcmp(tail, "/libp3dtool.so") == 0)) {
_dtool_name = head;
}
}

View File

@ -57,6 +57,12 @@ $[cdefine PANDA_NUMERIC_VERSION]
out from CVS by the builder). */
# define PANDA_VERSION_STR "$[PANDA_VERSION_STR]"
/* This is the version of the Panda3D ABI expressed as a string.
This usually means the major and minor version. It should be the
same for Panda3D versions that are supposed to be backward
ABI compatible with each other. */
# define PANDA_ABI_VERSION_STR "$[PANDA_MAJOR_VERSION].$[PANDA_MINOR_VERSION]"
/* This is a string indicating who has provided this distribution. */
# define PANDA_DISTRIBUTOR "$[PANDA_DISTRIBUTOR]"

View File

@ -892,6 +892,7 @@ def CompileLink(dll, obj, opts):
cmd = 'g++ -undefined dynamic_lookup'
if ("BUNDLE" in opts): cmd += ' -bundle '
else: cmd += ' -dynamiclib -install_name ' + os.path.basename(dll)
cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp -L/usr/X11R6/lib'
else:
cmd = 'g++ -shared'
@ -1516,6 +1517,7 @@ PANDAVERSION_H="""
#define PANDA_VERSION $NVERSION
#define PANDA_NUMERIC_VERSION $NVERSION
#define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
#define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
#define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
#define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
#define PANDA_PACKAGE_HOST_URL "http://runtime.panda3d.org/"
@ -1526,6 +1528,7 @@ PANDAVERSION_H_RUNTIME="""
#define PANDA_MINOR_VERSION 0
#define PANDA_SEQUENCE_VERSION 0
#define PANDA_VERSION_STR "0.0.0"
#define PANDA_ABI_VERSION_STR "0.0"
#define P3D_PLUGIN_MAJOR_VERSION $VERSION1
#define P3D_PLUGIN_MINOR_VERSION $VERSION2
#define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3