From: Sebastian Harl Date: Wed, 22 Jan 2014 12:34:30 +0000 (+0100) Subject: configure: Fixed linker options when checking for amqp_tcp_socket_new. X-Git-Tag: collectd-5.4.1~1^2~1^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1c04bafe27990a337df6b9a8582669fe110eb2ae;p=collectd.git configure: Fixed linker options when checking for amqp_tcp_socket_new. 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. --- diff --git a/configure.in b/configure.in index 81b26116..0f2db078 100644 --- a/configure.in +++ b/configure.in @@ -3534,8 +3534,10 @@ if test "x$with_librabbitmq" = "xyes" 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"]) @@ -3559,6 +3561,7 @@ then CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" fi # }}}