Use pkg-config to add libraries needed by gpac_static
Patch provide on the same License of x264, on purpose to avoid creating problems and the x264 authors can modify it as they wish
Merge request reports
Activity
mentioned in merge request !60 (merged)
Hi.
Your patch doesn't work in most cases:
- It spams during configure if gpac.pc is not installed.
- If gpac.pc is found than in most cases detection will fail with <gpac/isomedia.h> not found because you do not add path of headers to CFLAGS from pkg-config.
- imho GPAC's package file gpac.pc is broken when generated for static library. It contains both
-lgpac
and-lgpac_static
and so will fail if onlylibgpac_static.a
is installed, and if both are installed than I don't know which one it would try link to. That is the main reason why pkg-config detection wasn't add before.
I created alternative patch !60 (merged) which try to fix all this problems. As item 3 can only be fixed in GPAC itself than as workaround I have added detection that if pkg-config returns non-working setup than I fallback to old code path.
first point is good , I will check , and reply later
my all point is that
pkg-config --static --libs gpac
returns [1] and that is the correct[1]
-lgpac -lgpac_static -lm -lGL -lGLU -lX11 -lz -lssl -lcrypto -ljpeg -lpng -lavcodec -lavformat -lavutil -lavdevice -lswscale -lswresample -lavfilter -lfaad -lmad -lxvidcore -la52 -lvorbis -ltheora -lopenjp2 -lpthread -ldl -llzma
imho GPAC need to have 2 separate pkg-config files gpac.pc and gpac-static.pc as this libraries have different names. Such decision was made for libav to fix similar problem. And gpac-static.pc wouldn't need separate
Libs.private
section (dependencies should be inLibs
) and so no need for--static
param for pkg-config call.Replaced by !60 (merged)
in reply of these last two comment , I had analyzed the problem and you are right and you choose the best option, IMO. Thank you .
From https://people.freedesktop.org/~dbn/pkg-config-guide.html#writing there is nothing we can do
gpac.pc
prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib64 includedir=${exec_prefix}/include Name: gpac Description: GPAC Multimedia Framework URL: http://gpac.io Version:1.0.1 Cflags: -I${prefix}/include Libs: -L${libdir} -lgpac Libs.private: -lgpac_static -lm -lGL -lGLU -lX11 -lz -lssl -lcrypto -ljpeg -lpng -L/usr/lib64 -lavcodec -lavformat -lavutil -lavdevice -lswscale -lswresample-lavfilter -lfaad -lmad -lxvidcore -la52 -lvorbis -ltheora -lopenjp2 -lpthread -ldl -llzma