X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=config%2Famanda%2Fas_needed.m4;fp=config%2Famanda%2Fas_needed.m4;h=a51a99160497661d846b4af9048bef3cf5894bcb;hb=538ae376635af705ebcd686f3b4b7b72a6652985;hp=0000000000000000000000000000000000000000;hpb=11425c69eb58b6103beb68adc13912735ba36975;p=debian%2Famanda diff --git a/config/amanda/as_needed.m4 b/config/amanda/as_needed.m4 new file mode 100644 index 0000000..a51a991 --- /dev/null +++ b/config/amanda/as_needed.m4 @@ -0,0 +1,25 @@ +# SYNOPSIS +# +# AMANDA_AS_NEEDED +# +# OVERVIEW +# Add --as-needed ld flag to LD_FLAGS except when using readline. On +# some platforms, readline does not correctly advertise it's requirements, +# causing ld errors. In Amanda, readline is used by amrecover/amoldrecover. +# +AC_DEFUN([AMANDA_AS_NEEDED], [ + AC_ARG_ENABLE([as-needed], + AS_HELP_STRING([--enable-as-needed], + [enable use od --as-needed linker flag]), + [ WANT_AS_NEEDED=$enableval ], [ WANT_AS_NEEDED=no ]) + + AM_CONDITIONAL([WANT_AS_NEEDED], [test x"$WANT_AS_NEEDED" = x"yes"]) + + if test x"$WANT_AS_NEEDED" = x"yes"; then + AS_NEEDED_FLAGS="-Wl,--as-needed" + else + AS_NEEDED_FLAGS="" + fi + AC_SUBST(AS_NEEDED_FLAGS) +]) +