Skip to content

When ffmpeg use *-uninstalled.pc, configure fail #458

@moi15moi

Description

@moi15moi

Currently, ffms2 attempts to link against ffmpeg to determine whether the -Wl,-Bsymbolic flag is required:

ffms2/configure.ac

Lines 105 to 146 in 6601f8c

AC_DEFUN([TEST_FFMPEG],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
]],[[
avformat_network_init();
swscale_version();
]])], [eval $1=yes], [eval $1=no])
])
AC_MSG_CHECKING([whether FFmpeg works])
LIBS="$_LIBS $FFMPEG_LIBS"
TEST_FFMPEG([FFMPEG_WORKS])
AC_MSG_RESULT([$FFMPEG_WORKS])
if test "$FFMPEG_WORKS" = no; then
AC_MSG_FAILURE([cannot link with FFmpeg])
fi
src_core_libffms2_la_LDFLAGS=""
AC_MSG_CHECKING([whether -Wl,-Bsymbolic is needed])
if test "$enable_shared" = yes; then
_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared $lt_prog_compiler_pic"
TEST_FFMPEG([no_bsymbolic])
if test "$no_bsymbolic" = "no"; then
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
TEST_FFMPEG([bsymbolic])
if test "$bsymbolic" = "yes"; then
src_core_libffms2_la_LDFLAGS="$src_core_libffms2_la_LDFLAGS -Wl,-Bsymbolic"
else
AC_MSG_RESULT($bsymbolic)
AC_MSG_FAILURE([cannot build ffms2 as a shared library])
fi
else
bsymbolic=no
fi
LDFLAGS="$_LDFLAGS"
src_core_libffms2_la_LDFLAGS="$src_core_libffms2_la_LDFLAGS -version-info $VERSION_INFO"
else
bsymbolic=no
fi
AC_SUBST([src_core_libffms2_la_LDFLAGS])

ffmpeg documentation explains when this flag is necessary: https://ffmpeg.org/platform.html#Advanced-linking-configuration

The problem is that ffmpeg may not be available at configure time. For example when the user is relying on a *-uninstalled.pc (ex: libswresample-uninstalled.pc) file. In this situation, the current test will fail, making it impossible to build ffms2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions