From 34d0186ecd6a1506e1f2cd65023c78f123ea4462 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Mon, 6 Dec 2021 18:22:02 +0100 Subject: [PATCH] configure.ac: fix dynamic_lookup support detection The AX_APPEND_FLAG arguments were reversed, the program was not escaped from m4 macros, and the function was declared in the body of the main function, so it just couldn't work. After fixing this, static module bank is back working normally on MacOSX. --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 550d0ac6897e..96bfff85871d 100644 --- a/configure.ac +++ b/configure.ac @@ -211,12 +211,12 @@ case "${host_os}" in dnl to disable the static bank loader. AC_MSG_CHECKING([if -Wl,-U is allowed]) VLC_SAVE_FLAGS - AX_APPEND_FLAG([LDFLAGS],[-Wl,-U,_my_array -no-undefined]) + AX_APPEND_FLAG([-Wl,-U,_my_array],[LDFLAGS]) AC_LINK_IFELSE( - [AC_LANG_PROGRAM([], [dnl + [AC_LANG_PROGRAM([[ __attribute__((visibility("default"))) extern int my_array[]; -__attribute__((visibility("default"))) int foo() { return my_array[0]; } -])], +int foo() { return my_array[0]; } +]],[[return foo();]])], [ VLC_ADD_LDFLAGS([libvlccore],[-Wl,-U,_vlc_static_modules]) VLC_ADD_LDFLAGS([libvlc vlc],[-Wl,-undefined,dynamic_lookup]) -- GitLab