-release not being set on libtool generation of php_mapscript.la #4525

Closed
akrherz opened this Issue Nov 14, 2012 · 9 comments

Projects

None yet

3 participants

@akrherz
Contributor
akrherz commented Nov 14, 2012

(edited issue to be more accurate)

libtool's generation of php_mapscript.la is missing release ID, so the resulting so ends up with .0.0.0 , causing this at installation:

-rwxr-xr-x. 1 root root 1124 Nov 14 10:18 php_mapscript.la
lrwxrwxrwx. 1 root root 22 Nov 14 10:18 php_mapscript.so -> php_mapscript.so.0.0.0
lrwxrwxrwx. 1 root root 22 Nov 14 10:18 php_mapscript.so.0 -> php_mapscript.so.0.0.0
-rwxr-xr-x. 1 root root 1540855 Nov 14 10:18 php_mapscript.so.0.0.0

thank you for the help below to straighten me out on this.

@tbonfort
Member

From the libtool page you linked:

Never try to set the interface numbers so that they correspond to the release number of your package.
This is an abuse that only fosters misunderstanding of the purpose of library versions.
Instead, use the -release flag (see Release numbers), but be warned that every release of your package will not be binary compatible with any other release.

so the current behavior seems correct to me, no?

@aboudreault
Member

@tbonfort the problem is the final generated library: which ends with .so.0.0.0

@akrherz
Contributor
akrherz commented Nov 14, 2012

Thanks. The problem is that the generated php_mapscript.so is named like so

php_mapscript.so.0.0.0

This causes a problem when it overwrites that file in the php modules folder. Sorry for my ignorance

@aboudreault
Member

not a big deal....... but would be good for 6.2.1.

@akrherz
Contributor
akrherz commented Nov 14, 2012

Oh, the problem is that the libtool command in the php mapscript folder is not setting -release

@tbonfort
Member

The 0.0.0 is what is expected as it's the first release using libtool. If you had betas or pre-release code installed before, then yes I agree that it will have been overwritten.

@tbonfort tbonfort was assigned Nov 14, 2012
@tbonfort
Member

I'll take care of adding version-info for coming releases, and add -release for php mapscript.

@akrherz
Contributor
akrherz commented Nov 14, 2012

For my sanity and attempt to learn something, this is the proper patch?

diff --git a/mapscript/php/Makefile.in b/mapscript/php/Makefile.in
index 20c9adb..baf71dd 100644
--- a/mapscript/php/Makefile.in
+++ b/mapscript/php/Makefile.in
@@ -63,6 +63,11 @@ CFLAGS = @CFLAGS@ @USE_PHP_REGEX@ -DCOMPILE_DL=1 @PHP_VERSION_FLAG@
 PHP_INC = `$(PHPCONFIG) --includes ` @APACHE_INC@

 #
+### MS_VERSION - Set by configure based in mapserver.h
+#
+MS_VERSION=     @MS_VERSION@
+
+#
 # IMPORTANT NOTE ABOUT REGEX FOR PHP_MAPSCRIPT USERS:
 #
 # In order to compile the PHP_MAPSCRIPT module, we have to make MapServer
@@ -114,10 +119,10 @@ PHPPROJ_OBJS = php_mapscript_util.$(OBJ_SUFFIX) php_proj.$(OBJ_SUFFIX) $(PHP_REG


 php_mapscript.la: $(PHPMS_OBJS) ../../libmapserver.la
-       $(LINK) -o $@ $(PHPMS_OBJS) $(MS_LIBS)
+       $(LINK) -release $(MS_VERSION) -o $@ $(PHPMS_OBJS) $(MS_LIBS)

 php_proj.la:  $(PHPPROJ_OBJS) ../libmapserver.la
-       $(LINK) -o $@ $(PHPPROJ_OBJS) $(MS_LIBS)
+       $(LINK) -release $(MS_VERSION) -o $@ $(PHPPROJ_OBJS) $(MS_LIBS)

 %.lo: %.c php_mapscript_util.h php_mapscript.h
        $(LTCC) $(CC) $(CFLAGS112) -c -o $@ $<

If not, I'll shut up now and stop wasting your time. Thank you for the quick responses.

@tbonfort tbonfort closed this in 7364f12 Dec 11, 2012
@tbonfort
Member

@akrherz sorry for not responding, I've applied your patch now, which somewhat implies it seemed like the proper one :) .
thanks,
thomas

@mkofahl mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
@tbonfort tbonfort suffix php mapscript lib with version number (#4525)
closes #4525
a6c4b67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment