#4183 closed defect (fixed)
--shlibdir does not default to --libdir
Reported by: | JohnCC | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | build system |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Compilation with --enable-shared installed .a libs in /usr/lib64 and .so libs in /usr/lib.
Compilation line:
./configure --prefix=/usr --libdir=/usr/lib64 --enable-shared
Found the .so libraries for libav* related libraries in /usr/lib. Output of make V=1 install (excerpt):
install -m 644 libavdevice/libavdevice.a "/usr/lib64" ranlib "/usr/lib64/libavdevice.a" mkdir -p "/usr/lib" install -m 755 libavdevice/libavdevice.so "/usr/lib/libavdevice.so.56.3.100" strip "/usr/lib/libavdevice.so.56.3.100" (cd "/usr/lib" && ln -s -f libavdevice.so.56.3.100 libavdevice.so.56); (cd "/usr/lib" && ln -s -f libavdevice.so.5 mkdir -p "/usr/lib64"
Same for libavfilter etc.
This is Slackware64 current (14.1+)
Change History (7)
comment:1 by , 10 years ago
Component: | avdevice → build system |
---|---|
Status: | new → open |
comment:2 by , 10 years ago
but the current behaviour may be intended
At least in Slackware, this behavour is not expected, as /usr/lib is not searched on 64-bit systems. And, when in 32-compatibility mode, it would probably cause problems, as the library is really 64-bit:
/usr/lib$ file libavcodec.so.56.14.100
libavcodec.so.56.14.100: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
/usr/lib$ file libavdevice.so.56.3.100
libavdevice.so.56.3.100: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
comment:3 by , 10 years ago
There is a configure option:
-shlibdir "install shared libs in DIR [PREFIX/lib]"
Quite interesting, if you run configure -libdir=/usr/lib64 --enable-shared --enable-static
, everything goes into the specified -libdir without using -shlibdir.
comment:4 by , 10 years ago
There is '-' missing in your command. I suppose that is a typo?
If doing:
./configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --enable-static
Then the installation is still wrong:
install -m 644 libavcodec/libavcodec.a "/usr/lib64" ranlib "/usr/lib64/libavcodec.a" mkdir -p "/usr/lib" install -m 755 libavcodec/libavcodec.so "/usr/lib/libavcodec.so.56.14.100" strip "/usr/lib/libavcodec.so.56.14.100"
And with your 'Quite interesting' suggestion (though with the --libdir corrected), I get:
mkdir -p "/usr/lib64" install -m 644 libavcodec/libavcodec.a "/usr/lib64" ranlib "/usr/lib64/libavcodec.a" mkdir -p "/usr/local/lib" install -m 755 libavcodec/libavcodec.so "/usr/local/lib/libavcodec.so.56.14.100" strip "/usr/local/lib/libavcodec.so.56.14.100" (cd "/usr/local/lib" && ln -s -f libavcodec.so.56.14.100 libavcodec.so.56); (cd "/usr/local/lib" && ln -s -f libav
So, the static libraries are following the --libdir=/usr/lib64 instruction, and the shared libs go into the default /usr/local/lib directory.
I get the instruction --shlibdir=DIR - thanks for that. I do not think this is a very well-known configure option. In all the years I use Linux, I never used it, or seen it. I just went through the configures from glib/goocanvas/gobject-introspection, and about 10 more. None has it.
I'd suggest a slight modification to the configure script: If --libdir is specified, and --shlibdir is not, then set both to the same value. I suspect that is by far the most common case.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Summary: | Compilation problem with libav* → --shlibdir does not default to --libdir |
Should be fixed in 4fa42e04 - thank you for the report!
follow-up: 7 comment:6 by , 10 years ago
This fix introduces a problem:
LIBDIR=$(DESTDIR)${prefix}/lib SHLIBDIR=$(DESTDIR)${LIBDIR}
This means SHLIBDIR will expand DESTDIR twice.
For example, make install DESTDIR=/tmp/ffmpeg-install gives the following results
/tmp/ffmpeg-install/tmp/ffmpeg-install/usr/local/lib/libavcodec.56.20.100.dylib vs /tmp/ffmpeg-install/usr/local/bin/ffmpeg
comment:7 by , 10 years ago
Replying to jstrom:
This fix introduces a problem:
LIBDIR=$(DESTDIR)${prefix}/lib SHLIBDIR=$(DESTDIR)${LIBDIR}
shlibdir_default='${LIBDIR}'
is not in configure anymore so i dont understand your comment
I sent a patch but the current behaviour may be intended.