is there a way i can configure to build ffmpeg shared libraries for android without version number suffixes? im able to build with different options but always get files like "libavcodec.so.57". i would need the libraries without suffixes like "libavcodec.so". i thought the option "--disable-symver" would do the trick but unfortunately it didn't. the problem is that i have a library (.so file) that depends on ffmpeg shared libraries without suffixes and therefore can't load those im getting built. i have followed mostly the instructions here.
asking questions leads always to finding answers. that's why i was successful, digging into the make files helped. do the following:
change
SLIBNAME_WITH_VERSION=$(SLIBNAME).$(LIBVERSION) SLIBNAME_WITH_MAJOR=$(SLIBNAME).$(LIBMAJOR)
to:
SLIBNAME_WITH_VERSION=$(SLIBNAME)
SLIBNAME_WITH_MAJOR=$(SLIBNAME)
change
SLIB_INSTALL_NAME=$(SLIBNAME_WITH_VERSION) SLIB_INSTALL_LINKS=$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
to:
SLIB_INSTALL_NAME=$(SLIBNAME)
SLIB_INSTALL_LINKS=
run "make" or "make -j$(nproc)"
"make install"
now you will have shared libraries without suffixes.
you can check their dependencies by
"readelf -d somefile.so"
No need to change config.mak
Just add --target-os=android to configure call
My example
NDK=${HOME}/android-sdk-linux/ndk-bundle
ABI=arm
./configure \
--arch=$ABI \
--target-os=android \
--disable-everything \
--disable-symver \
--enable-runtime-cpudetect \
--enable-pic \
--enable-shared \
--disable-static \
--prefix=../build/$ABI \
--cross-prefix=$NDK/toolchains/$ABI-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/$ABI-linux-androideabi- \
--sysroot=$NDK/platforms/android-26/arch-$ABI \
--extra-cflags="-march=armv7-a -mfloat-abi=softfp -fPIC -DANDROID" \
--extra-ldflags="" \
|| exit 1
make clean
make -j4 || exit 1
make install || exit 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With