From ff90a8784cf22ada7bba75f90460b063818abda7 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 11 May 2014 14:38:52 +0100 Subject: [PATCH] Fix build for darwin Fix build for darwin, when ./configured --disable-driglx-direct - darwin ld doesn't support -Bsymbolic or --version-script, so check if ld supports those options before using them - define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak symbols isn't supported - default to -with-dri-drivers=swrast v2: Use -Wl,-Bsymbolic, as before, not -Bsymbolic Test that ld --version-script works, rather than just looking for it in ld --help Don't use -Wl,--no-undefined on darwin, either Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Emil Velikov --- configure.ac | 44 +++++++++++++++++++++ src/egl/main/Makefile.am | 2 +- src/gallium/Automake.inc | 8 ++++ src/gallium/targets/egl-static/Makefile.am | 2 + src/gallium/targets/gbm/Makefile.am | 2 + src/gallium/targets/opencl/Makefile.am | 2 + src/gallium/targets/pipe-loader/Makefile.am | 2 + src/glx/Makefile.am | 2 +- src/mesa/drivers/dri/Makefile.am | 2 +- 9 files changed, 63 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 76d13337f9e..675a4a67faa 100644 --- a/configure.ac +++ b/configure.ac @@ -315,6 +315,22 @@ if test "x$enable_debug" = xyes; then fi fi +dnl +dnl Check if linker supports -Bsymbolic +dnl +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,-Bsymbolic" +AC_MSG_CHECKING([if ld supports -Bsymbolic]) +AC_LINK_IFELSE( + [AC_LANG_SOURCE([int main() { return 0;}])], + [AC_MSG_RESULT([yes]) + BSYMBOLIC="-Wl,-Bsymbolic";], + [AC_MSG_RESULT([no]) + BSYMBOLIC="";]) +LDFLAGS=$save_LDFLAGS + +AC_SUBST([BSYMBOLIC]) + dnl dnl Check if linker supports garbage collection dnl @@ -344,6 +360,28 @@ esac AC_SUBST([LD_NO_UNDEFINED]) +dnl +dnl Check if linker supports version scripts +dnl +AC_MSG_CHECKING([if the linker supports version-scripts]) +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" +cat > conftest.map <