LDFLAGS=$save_LDFLAGS
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+dnl
+dnl Check if linker supports dynamic list files
+dnl
+AC_MSG_CHECKING([if the linker supports --dynamic-list])
+save_LDFLAGS=$LDFLAGS
+LDFLAGS="$LDFLAGS -Wl,--dynamic-list=conftest.dyn"
+cat > conftest.dyn <<EOF
+{
+ radeon_drm_winsys_create;
+};
+EOF
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([int main() { return 0;}])],
+ [have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)],
+ [have_ld_dynamic_list=no; AC_MSG_RESULT(no)])
+LDFLAGS=$save_LDFLAGS
+AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes")
+
dnl
dnl compatibility symlinks
dnl
-shrext .so \
-module \
-avoid-version \
- -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
$(GC_SECTIONS)
if HAVE_LD_VERSION_SCRIPT
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
endif # HAVE_LD_VERSION_SCRIPT
+if HAVE_LD_DYNAMIC_LIST
+gallium_dri_la_LDFLAGS += \
+ -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
+endif # HAVE_LD_DYNAMIC_LIST
+
gallium_dri_la_LIBADD = \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
-module \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
- -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau/vdpau.sym
endif # HAVE_LD_VERSION_SCRIPT
+if HAVE_LD_DYNAMIC_LIST
+libvdpau_gallium_la_LDFLAGS += \
+ -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
+endif # HAVE_LD_DYNAMIC_LIST
+
libvdpau_gallium_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \