From e6abf71b04e4170a26098d48e1ba384053a5252d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 10 Jan 2011 12:02:08 +0100 Subject: [PATCH] xbps-src: disable -Wl,--as-needed if $broken_as_needed is set. --- xbps-src/shutils/build_funcs.sh | 5 +++++ xbps-src/shutils/configure_funcs.sh | 4 ++++ xbps-src/shutils/tmpl_funcs.sh.in | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index 08675aed88a..a7271132cff 100644 --- a/xbps-src/shutils/build_funcs.sh +++ b/xbps-src/shutils/build_funcs.sh @@ -85,6 +85,11 @@ build_src_phase() fi fi + # Disable -Wl,--as-needed if requested! + if [ -n "$broken_as_needed" ]; then + export XBPS_LDFLAGS="$(echo $XBPS_LDFLAGS|sed -e "s|-Wl,--as-needed||g")" + fi + if [ "$build_style" = "custom-install" ]; then [ -n "$XBPS_LDFLAGS" ] && export LDFLAGS="$XBPS_LDFLAGS" run_func do_build diff --git a/xbps-src/shutils/configure_funcs.sh b/xbps-src/shutils/configure_funcs.sh index d19144946a3..4d3b3fd5e4c 100644 --- a/xbps-src/shutils/configure_funcs.sh +++ b/xbps-src/shutils/configure_funcs.sh @@ -113,6 +113,10 @@ configure_src_phase() conf_ldflags="$XBPS_LDFLAGS" fi + if [ -n "$broken_as_needed" ]; then + export XBPS_LDFLAGS="$(echo $XBPS_LDFLAGS|sed -e "s|-Wl,--as-needed||g")" + fi + case "$build_style" in gnu_configure|gnu-configure) run_func do_gnu_configure ;; configure) run_func do_configure ;; diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 9d0f0bf42a4..d43814eb838 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -75,7 +75,7 @@ reset_tmpl_vars() noarch subpackages sourcepkg gtk_iconcache_dirs \ abi_depends api_depends triggers openrc_services \ replaces system_accounts system_groups \ - build_wrksrc create_wrksrc \ + build_wrksrc create_wrksrc broken_as_needed \ ignore_vdeps_dir noverifyrdeps conflicts dkms_modules \ gconf_entries gconf_schemas stow_copy stow_copy_files \ pre_remove post_remove post_stow do_build do_install \