Skip to content
Snippets Groups Projects

Use pkg-config to add libraries needed by gpac_static

Closed Sérgio Basto requested to merge sergiomb2/x264:master into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Anton Mitrofanov mentioned in merge request !60 (merged)

    mentioned in merge request !60 (merged)

  • Hi.

    Your patch doesn't work in most cases:

    1. It spams during configure if gpac.pc is not installed.
    2. 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.
    3. 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 only libgpac_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

  • How [1] is correct if first 2 libs are "-lgpac -lgpac_static"? It should be only one of them (for static -lgpac_static).

  • 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 in Libs) and so no need for --static param for pkg-config call.

  • 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
Please register or sign in to reply
Loading