ColumPaget / libUseful

Programmers 'C' library of functions for: resizable strings, file and network access, string tokenization, pattern matching, terminal output, etc, etc
Other
14 stars 2 forks source link

headers installed twice #14

Closed andreasstieger closed 8 months ago

andreasstieger commented 8 months ago

The header files seem to be installed twice:

[   12s] + ./configure --host=x86_64-suse-linux --build=x86_64-suse-linux --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
[...]
[   22s] mkdir -p /home/abuild/rpmbuild/BUILDROOT/libUseful-5.9-2.1.x86_64/usr/include/libUseful-5.9
[   22s] cp *.h /home/abuild/rpmbuild/BUILDROOT/libUseful-5.9-2.1.x86_64/usr/include/libUseful-5.9
[   22s] mkdir -p /home/abuild/rpmbuild/BUILDROOT/libUseful-5.9-2.1.x86_64/usr/include/libUseful-5
[   22s] cp *.h /home/abuild/rpmbuild/BUILDROOT/libUseful-5.9-2.1.x86_64/usr/include/libUseful-5
/usr/include/libUseful-5.9/Array.h
/usr/include/libUseful-5/Array.h
ColumPaget commented 8 months ago

Yes, this one's intentional. The idea is that you can write programs using '#include "libUseful-5"', but if for some reason you wanted to be specific, maybe there's a feature that only exists in libUseful-5.9 or something, then you can specify the exact version.

I could maybe add an autoconf option to turn this on/off though?

andreasstieger commented 8 months ago

This.. is not how this is done for shared libraries. You could use feature flags that the consuming code could check for, or just look at the version macro. In other words, unless "5" and "5.9" are sonames it does not seem to make a lot of sense.

ColumPaget commented 8 months ago

What about a symlink from libUseful-5.9 to libUseful-5, would that work? It's just that way you can build against one version, or the other, as desired, just by changing #include and -lUseful-?

andreasstieger commented 8 months ago

That works. In fact this this is what %fdupes does in the spec (hardlinks in this case but this is not relevant)

ColumPaget commented 8 months ago

Okay, I'll set that up for the next release, and look into the soname thing. It'll take a few days due to other commitments right now.

ColumPaget commented 8 months ago

done using symlinks.