Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

src/Makefile.am shouldn't use -release #12

Open
danielj7 opened this Issue · 6 comments

2 participants

@danielj7

It's incorrect to use both -release and -version-info in libtidyp_la_LDFLAGS as it breaks binary compatibility between versions. From http://www.gnu.org/software/libtool/manual/libtool.html#Versioning :

"Note that this option causes a modification of the library name, so do not use it unless you want to break binary compatibility with any past library releases. In general, you should only use -release for package-internal libraries or for ones whose interfaces change very frequently."

When I build libtidyp on Mac OS X, the library is named "libtidyp-1.04.0.dylib" and since the loader loads libraries by name, if the next version is, say, 1.05, the library will not be found. Never try to outsmart libtool's versioning system; it's designed to do the Right Thing on all platforms. Using -release happens to work on ELF-based platforms since it's more forgiving of soname changes, but other platforms are more strict.

@petdance
Owner

Thanks, I'll look into this. I'm stumbling my way through the Autotools, so any help is more than welcome. A patch/fork would be even better!

@danielj7

I would just remove the -release option and then always follow the instructions in configure.ac for making releases. It'll break compatibility with 1.04, but that'll happen anyway. It'll be stable going forward.

As for autotools; it's the worst build system around, except for all the others. :)

I included a patch below. Is there a better way to attach patches? I haven't used GitHub much before.

diff --git a/src/Makefile.am b/src/Makefile.am
index 685037a..cb83feb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,7 +69,7 @@ libtidyp_la_SOURCES = \
 
 libtidyp_la_LDFLAGS = \
        -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-       -release $(LT_RELEASE) -no-undefined -export-dynamic
+       -no-undefined -export-dynamic
 
 HFILES = \
        access.h        attrdict.h      attrs.h         clean.h \
@danielj7

Oops, I forgot it was using Markdown.

@petdance
Owner

Removing -release seems fine on Linux, but on my Mac there is sorrow:

Making all in src
/Users/alester/tidyp/src
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"tidyp\" -DPACKAGE_TARNAME=\"tidyp\" -DPACKAGE_VERSION=\"1.04\" -DPACKAGE_STRING=\"tidyp\ 1.04\" -DPACKAGE_BUGREPORT=\"andy@petdance.com\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSUPPORT_ACCESSIBILITY_CHECKS=1 -DSUPPORT_UTF16_ENCODINGS=1 -DSUPPORT_ASIAN_ENCODINGS=1 -I. -I../include   -Wall  -MT access.lo -MD -MP -MF .deps/access.Tpo -c -o access.lo access.c
../libtool: line 829: X--tag=CC: command not found
../libtool: line 862: libtool: ignoring unknown tag : command not found
../libtool: line 829: X--mode=compile: command not found
../libtool: line 996: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 997: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 1140: Xgcc: command not found
../libtool: line 1140: X-DPACKAGE_NAME="tidyp": command not found
../libtool: line 1140: X-DPACKAGE_TARNAME="tidyp": command not found
../libtool: line 1140: X-DPACKAGE_VERSION="1.04": command not found
../libtool: line 1140: X-DPACKAGE_STRING="tidyp 1.04": command not found
../libtool: line 1140: X-DPACKAGE_BUGREPORT="andy@petdance.com": command not found
../libtool: line 1140: X-DSTDC_HEADERS=1: command not found
../libtool: line 1140: X-DHAVE_SYS_TYPES_H=1: command not found
../libtool: line 1140: X-DHAVE_SYS_STAT_H=1: command not found
../libtool: line 1140: X-DHAVE_STDLIB_H=1: command not found
../libtool: line 1140: X-DHAVE_STRING_H=1: command not found
../libtool: line 1140: X-DHAVE_MEMORY_H=1: command not found
../libtool: line 1140: X-DHAVE_STRINGS_H=1: command not found
../libtool: line 1140: X-DHAVE_INTTYPES_H=1: command not found
../libtool: line 1140: X-DHAVE_STDINT_H=1: command not found
../libtool: line 1140: X-DHAVE_UNISTD_H=1: command not found
../libtool: line 1140: X-DHAVE_DLFCN_H=1: command not found
../libtool: line 1140: X-DLT_OBJDIR=".libs/": No such file or directory
../libtool: line 1140: X-DSUPPORT_ACCESSIBILITY_CHECKS=1: command not found
../libtool: line 1140: X-DSUPPORT_UTF16_ENCODINGS=1: command not found
../libtool: line 1140: X-DSUPPORT_ASIAN_ENCODINGS=1: command not found
../libtool: line 1140: X-I.: command not found
../libtool: line 1140: X-I../include: No such file or directory
../libtool: line 1140: X-Wall: command not found
../libtool: line 1140: X-MT: command not found
../libtool: line 1140: Xaccess.lo: command not found
../libtool: line 1140: X-MD: command not found
../libtool: line 1140: X-MP: command not found
../libtool: line 1140: X-MF: command not found
../libtool: line 1140: X.deps/access.Tpo: No such file or directory
../libtool: line 1140: X-c: command not found
../libtool: line 1192: Xaccess.lo: command not found
../libtool: line 1197: libtool: compile: cannot determine name of library object from `': command not found
make[1]: *** [access.lo] Error 1
make: *** [all-recursive] Error 1
@petdance
Owner

Separate from that, I think it needs to be nailed down how things are getting versioned.

@danielj7

Ok, that's being caused by libtoolize replacing libtool files in the source tree with older components leading to mixed versions. You might need to install a newer libtool and/or clear out all autotool files and start again. I'm using 2.2.10 and it works fine.

The way that versioning should work with libtool goes like this:

Use -version-info CURRENT:REVISION:AGE

Start each value at 0.
If there are any source code changes, increment REVISION.
If any changes are made to the interface, increment CURRENT and AGE, and set REVISION to 0.
If any functions are removed or parameters changed, set AGE to 0.

Then libtool will manage the versioning correctly on all platforms. The actual version numbers may be different between platforms, but they'll be consistent within a given platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.