This fixes the check when using GCC's --as-needed which fails when options are
not specified in the right order. Libraries (-l options) have to be specified
after any source files. autoconf does the right thing when using $LIBS for
that case rather than $LDFLAGS.
then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
+ SAVE_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
- LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags -lrabbitmq"
+ LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
+ LIBS="-lrabbitmq"
AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
+ LIBS="$SAVE_LIBS"
fi
# }}}