6 # Add --as-needed ld flag to LD_FLAGS except when using readline. On
7 # some platforms, readline does not correctly advertise it's requirements,
8 # causing ld errors. In Amanda, readline is used by amrecover/amoldrecover.
10 AC_DEFUN([AMANDA_AS_NEEDED], [
11 AC_ARG_ENABLE([as-needed],
12 AS_HELP_STRING([--enable-as-needed],
13 [enable use od --as-needed linker flag]),
14 [ WANT_AS_NEEDED=$enableval ], [ WANT_AS_NEEDED=no ])
16 AM_CONDITIONAL([WANT_AS_NEEDED], [test x"$WANT_AS_NEEDED" = x"yes"])
18 if test x"$WANT_AS_NEEDED" = x"yes"; then
19 AS_NEEDED_FLAGS="-Wl,--as-needed"
23 AC_SUBST(AS_NEEDED_FLAGS)